public PolymorphicDeserializer(ILogger <PolymorphicDeserializer> logger, IPolymorphicCandidateProvider polymorphicCandidateProvider) { Logger = logger; PolymorphicCandidateProvider = polymorphicCandidateProvider; JsonSerializer = JsonSerializer.Create(new JsonSerializerSettings { Formatting = Formatting.Indented, Error = (sender, args) => { Logger.LogInformation(args.ErrorContext.Error.Message); args.ErrorContext.Handled = true; }, }); }
public PolymorphicFormConverter(ILogger <PolymorphicFormConverter> logger, IPolymorphicCandidateProvider polymorphicCandidateProvider, IHumanizer humanizer) { Logger = logger; PolymorphicCandidateProvider = polymorphicCandidateProvider; Humanizer = humanizer; JsonWebSerializer = JsonSerializer.Create(new JsonSerializerSettings { Formatting = Formatting.Indented, ContractResolver = new CamelCasePropertyNamesContractResolver(), Error = (sender, args) => { Logger.LogInformation(args.ErrorContext.Error.Message); args.ErrorContext.Handled = true; }, }); }
public PolymorphicSerializer(ILogger <PolymorphicSerializer> logger, IPolymorphicCandidateProvider polymorphicCandidateProvider) { Logger = logger; PolymorphicCandidateProvider = polymorphicCandidateProvider; }