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