コード例 #1
0
 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;
         },
     });
 }
コード例 #2
0
 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;
         },
     });
 }
コード例 #3
0
 public PolymorphicSerializer(ILogger <PolymorphicSerializer> logger, IPolymorphicCandidateProvider polymorphicCandidateProvider)
 {
     Logger = logger;
     PolymorphicCandidateProvider = polymorphicCandidateProvider;
 }