I have a common library with some objects in it. Then I have a service project that references the common library and creates some derived types from objects in the common library.
I want my service to serialize the derived types as their base types defined in the common library.
I cannot use KnownTypes on the objects in the common library because I don't want the common library referencing the service assemblies.
So how can I have wcf serialize the derived types as their base types?
I wish I could do something like...
[DataContract(SerializeAsType = typeof(BaseType))]
public class DerivedType : BaseType
{
}
Is anything like this possible?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…