Class DerivedTypeAttribute

Namespace
Cratis.Serialization
Assembly
Cratis.Fundamentals.dll

Attribute used to adorn types that represent a unique type in the system and serializers need to recognize.

[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public sealed class DerivedTypeAttribute : Attribute
Inheritance
DerivedTypeAttribute
Inherited Members
Extension Methods

Remarks

Initializes a new instance of the DerivedTypeAttribute class.

Constructors

DerivedTypeAttribute(string, Type?)

Attribute used to adorn types that represent a unique type in the system and serializers need to recognize.

public DerivedTypeAttribute(string identifier, Type? targetType = null)

Parameters

identifier string

Arbitrary string that uniquely identifies the derived type.

targetType Type

Optional target type the derived type is for.

Remarks

Initializes a new instance of the DerivedTypeAttribute class.

Properties

Identifier

Gets the unique identifier of the derived type.

public DerivedTypeId Identifier { get; }

Property Value

DerivedTypeId

TargetType

Gets the optional target type.

public Type? TargetType { get; }

Property Value

Type