private object InvokeGenericMethod(MethodInfo method, Type type, SerializerRegistry registry) { MethodInfo m = method .MakeGenericMethod(type.GetGenericArguments() .First()); return(m.Invoke(this, new object[] { type, registry })); }
public virtual void ConfigureSerializers(SerializerRegistry serializers) { serializers.Add(new IDSerializer()); serializers.Add(new RefSerializer()); }
protected abstract string GenerateGenericSchema <T>(Type type, SerializerRegistry registry);
protected abstract JsonConverter CreateGenericConverter <T>(Type type, SerializerRegistry registry);
public override string GenerateSchema(Type type, SerializerRegistry registry) => (string)InvokeGenericMethod(__generateGenericSchemaMethod, type, registry);
public override JsonConverter CreateConverter(Type type, SerializerRegistry registry) => (JsonConverter)InvokeGenericMethod(__createGenericConverterMethod, type, registry);
internal ContractTypeSerializerOptions(SerializerRegistry serializers, JsonSerializerSettings jsonSettings) { Serializers = Check.NotNull(serializers, nameof(serializers)); JsonSettings = Check.NotNull(jsonSettings, nameof(jsonSettings)); }
public CustomSerializerResolver(IContractResolver actual, SerializerRegistry serializers) => (_actual, _serializers) = (actual, serializers);