- , , .
, , SomeUnit.
IReliableQueue<BaseClass> myQueue = ...;
SomeUnit myData = ...;
await myQueue.EnqueueAsync(txn, myData);
Deserializer , BaseClass, SomeUnit.
, KnownTypeAttribute , , .
[DataContract]
[KnownType(typeof(SomeUnit))]
public class BaseClass
{
...
}
[DataContract]
public class SomeUnit : BaseClass
{
...
}
[KnownType] . :
№1
- .
[DataContract]
[KnownType(typeof(SomeUnit))]
public class Wrapper
{
[DataMember]
public IUnit Value { get; set; }
}
[DataContract]
public class SomeUnit : IUnit
{
...
}
№ 2
DataContractSerializer.
, , , .
№ 3
(app.config) .