Class SurrogateContract
- Namespace
- ShapeShift.Schema
- Assembly
- ShapeShift.dll
Describes a type that is serialized by first converting it to a surrogate type.
public sealed class SurrogateContract : DataContract
- Inheritance
-
SurrogateContract
- Inherited Members
Remarks
The serialized form is exactly that of SurrogateType. This contract exists so that consumers can recognize the .NET type that a payload maps onto.
Constructors
SurrogateContract(Type, DataContract)
Initializes a new instance of the SurrogateContract class.
public SurrogateContract(Type dataType, DataContract surrogateType)
Parameters
dataTypeType- The .NET type that this contract describes.
surrogateTypeDataContractThe contract of the type that is actually serialized.
Properties
Kind
Gets the kind of this contract, which identifies the concrete subclass.
public override DataContractKind Kind { get; }
Property Value
ReferencedContracts
Gets the contracts that this contract directly refers to.
public override IEnumerable<DataContract> ReferencedContracts { get; }
Property Value
Remarks
The sequence may contain the same contract more than once, and (for recursive types) may transitively include this contract itself.
SurrogateType
Gets the contract of the type that is actually serialized.
public DataContract SurrogateType { get; }