Interface IJsonConverterFactory
- Namespace
- Nerdbank.Json
- Assembly
- Nerdbank.Json.dll
Creates JsonConverter instances for types discovered at runtime.
public interface IJsonConverterFactory
Methods
CreateConverter(Type, ITypeShape?, in ConverterContext)
Creates a converter for the requested type if this factory applies.
JsonConverter? CreateConverter(Type type, ITypeShape? shape, in ConverterContext context)
Parameters
typeTypeThe requested data type.
shapeITypeShapeThe PolyType shape describing
type, when available.contextConverterContextA context that can resolve additional converters needed by the created converter.
Returns
- JsonConverter
A converter if this factory applies to the type; otherwise, null.
Remarks
Implement ITypeShapeFunc when a generic type parameter is needed, and call Invoke<T>(T, ITypeShape, object?) to enter that generic context.