internal ReflectionJsonTypeInfo(JsonConverter converter, JsonSerializerOptions options) : base(converter, options) { NumberHandling = GetNumberHandlingForType(Type); PolymorphismOptions = JsonPolymorphismOptions.CreateFromAttributeDeclarations(Type); MapInterfaceTypesToCallbacks(); if (PropertyInfoForTypeInfo.ConverterStrategy == ConverterStrategy.Object) { AddPropertiesAndParametersUsingReflection(); } Func <object>?createObject = Options.MemberAccessorStrategy.CreateConstructor(typeof(T)); if (converter.UsesDefaultConstructor) { SetCreateObject(createObject); } CreateObjectForExtensionDataProperty = createObject; }
/// <summary> /// Creates serialization metadata for a type using a simple converter. /// </summary> public SourceGenJsonTypeInfo(JsonConverter converter, JsonSerializerOptions options) : base(converter, options) { PolymorphismOptions = JsonPolymorphismOptions.CreateFromAttributeDeclarations(Type); MapInterfaceTypesToCallbacks(); }