I ran into a class design problem.
I am using a data serializer.
So, in the assembly that is used in all my applications, I have something like this:
[DataContract]
public class User
{
[DataMember]
public string displayName;
}
There are many more fields: I left only displayName, trying to compose my codelists.
However, one application is a server that requires the following serializer to apply to a single class, as follows:
[EseTable]
public class User
{
[EseText(bUnicode=true, maxChars=71)]
public string displayName;
}
ServerDatabase.dll is associated with .NET 4. In addition, the [Ese *] attributes are defined in DLLs that can only be loaded by the server component due to reasons due to my control, so I cannot just have one class with both sets of attributes shared by each subsystem.
I am currently writing something like this:
[DataContract]
public class User
{
[DataMember]
public string displayName;
}
[EseTable]
public class UserRecord: User
{
[EseText(bUnicode=true, maxChars=71)]
new public string displayName { get { return base.displayName; } set { base.displayName=value; } }
public UserRecord(User that)
{
base.displayName=that.displayName;
}
}
: .
, ?
!