Table of Contents

Class DelegateUnionTypeAliasProvider

Namespace
Nerdbank.Json
Assembly
Nerdbank.Json.dll

Supplies C# union case identifiers using a delegate that receives the union and payload types.

public sealed class DelegateUnionTypeAliasProvider : IUnionTypeAliasProvider
Inheritance
DelegateUnionTypeAliasProvider
Implements
Inherited Members

Constructors

DelegateUnionTypeAliasProvider(UnionCaseAliasResolver)

Supplies C# union case identifiers using a delegate that receives the union and payload types.

public DelegateUnionTypeAliasProvider(UnionCaseAliasResolver resolver)

Parameters

resolver UnionCaseAliasResolver

The thread-safe resolver, whose results must remain consistent while the provider is in use.

Methods

GetAlias(IUnionTypeShape, IUnionCaseShape)

Gets a custom identifier for a union case.

public 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.