internal sealed override JsonConverter <TTarget> CreateCastingConverter <TTarget>() { if (this is JsonConverter <TTarget> conv) { return(conv); } JsonSerializerOptions.CheckConverterNullabilityIsSameAsPropertyType(this, typeof(TTarget)); // Avoid layering casting converters by consulting any source converters directly. return (SourceConverterForCastingConverter?.CreateCastingConverter <TTarget>() ?? new CastingConverter <TTarget, T>(this)); }
internal sealed override JsonConverter <TTarget> CreateCastingConverter <TTarget>() { JsonSerializerOptions.CheckConverterNullabilityIsSameAsPropertyType(this, typeof(TTarget)); return(new CastingConverter <TTarget, T>(this)); }