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
resolverUnionCaseAliasResolverThe 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
unionShapeIUnionTypeShapeThe shape of the containing union.
caseShapeIUnionCaseShapeA case belonging to
unionShape.
Returns
- DerivedTypeIdentifier?
The custom identifier, or null to use the normal identifier.