JsonConverterAttribute
When placed on a property or type, specifies the converter type to use.
using System.Runtime.CompilerServices;
namespace System.Text.Json.Serialization
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property, AllowMultiple = false)]
public class JsonConverterAttribute : JsonAttribute
{
[System.Runtime.CompilerServices.Nullable(2)]
public Type ConverterType {
[System.Runtime.CompilerServices.NullableContext(2)]
get;
private set;
}
public JsonConverterAttribute(Type converterType)
{
ConverterType = converterType;
}
protected JsonConverterAttribute()
{
}
[return: System.Runtime.CompilerServices.Nullable(2)]
public virtual JsonConverter CreateConverter(Type typeToConvert)
{
return null;
}
}
}