Class JsonConverterAttribute
- Namespace
- Nerdbank.Json
- Assembly
- Nerdbank.Json.dll
Applies a custom JsonConverter<T> to a type or serialized member.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Interface|AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[AssociatedTypeAttribute("converterType", TypeShapeRequirements.Constructor)]
public class JsonConverterAttribute : Attribute
- Inheritance
-
JsonConverterAttribute
- Inherited Members
Remarks
Initializes a new instance of the JsonConverterAttribute class. PolyType associates the converter's constructor with the attributed type or member's type, including closed instantiations of open generic converters.
Constructors
JsonConverterAttribute(Type)
Applies a custom JsonConverter<T> to a type or serialized member.
public JsonConverterAttribute(Type converterType)
Parameters
converterTypeTypeThe converter type to activate.
Remarks
Initializes a new instance of the JsonConverterAttribute class. PolyType associates the converter's constructor with the attributed type or member's type, including closed instantiations of open generic converters.
Properties
ConverterType
Gets the converter type to activate.
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]
public Type ConverterType { get; }