Table of Contents

Interface IUnionTypeAliasProvider

Namespace
Nerdbank.MessagePack
Assembly
Nerdbank.MessagePack.dll

Supplies custom identifiers for cases of C# unions.

public interface IUnionTypeAliasProvider

Remarks

Implementations must be thread-safe and return consistent results for the lifetime of a serializer that uses them. Aliases are resolved while constructing converters, not for each serialized value.

Methods

GetAlias(IUnionTypeShape, IUnionCaseShape)

Gets a custom identifier for a union case.

DerivedTypeIdentifier? GetAlias(IUnionTypeShape unionShape, IUnionCaseShape caseShape)

Parameters

unionShape IUnionTypeShape

The shape of the containing union.

caseShape IUnionCaseShape

A case belonging to unionShape.

Returns

DerivedTypeIdentifier?

The custom identifier, or null to use the normal identifier.