CustomCreationConverter<T>
Creates a custom object.
            
                using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
namespace Newtonsoft.Json.Converters
{
    [System.Runtime.CompilerServices.NullableContext(1)]
    [System.Runtime.CompilerServices.Nullable(0)]
    [RequiresUnreferencedCode("Newtonsoft.Json relies on reflection over types that may be removed when trimming.")]
    [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Newtonsoft.Json relies on dynamically creating types that may not be available with Ahead of Time compilation.")]
    public abstract class CustomCreationConverter<[System.Runtime.CompilerServices.Nullable(2)] T> : JsonConverter
    {
        public override bool CanWrite => false;
        public override void WriteJson(JsonWriter writer, [System.Runtime.CompilerServices.Nullable(2)] object value, JsonSerializer serializer)
        {
            throw new NotSupportedException("CustomCreationConverter should only be used while deserializing.");
        }
        [return: System.Runtime.CompilerServices.Nullable(2)]
        public override object ReadJson(JsonReader reader, Type objectType, [System.Runtime.CompilerServices.Nullable(2)] object existingValue, JsonSerializer serializer)
        {
            if (reader.TokenType == JsonToken.Null)
                return null;
            T val = Create(objectType);
            if (val == null)
                throw new JsonSerializationException("No object created.");
            serializer.Populate(reader, val);
            return val;
        }
        public abstract T Create(Type objectType);
        public override bool CanConvert(Type objectType)
        {
            return typeof(T).IsAssignableFrom(objectType);
        }
    }
}