Class OptionalContract
- Namespace
- ShapeShift.Schema
- Assembly
- ShapeShift.dll
Describes a type whose value may be absent, such as Nullable<T>.
public sealed class OptionalContract : DataContract
- Inheritance
-
OptionalContract
- Inherited Members
Remarks
An absent value is encoded as null.
Constructors
OptionalContract(Type, DataContract)
Initializes a new instance of the OptionalContract class.
public OptionalContract(Type dataType, DataContract elementType)
Parameters
dataTypeType- The .NET type that this contract describes.
elementTypeDataContractThe contract describing the value when it is present.
Properties
ElementType
Gets the contract describing the value when it is present.
public DataContract ElementType { get; }
Property Value
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.