public HttpPipeReader(IJsonSerializer serializer,
                       IJsonSerializerSettings settings,
                       IHttpContextAccessor httpContextAccessor)
 {
     _serializer          = serializer ?? throw new ArgumentNullException(nameof(serializer));
     _settings            = settings ?? throw new ArgumentNullException(nameof(settings));
     _httpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor));
 }
Example #2
0
 private static JsonSerializerOptions ToJsonSerializerOptions(IJsonSerializerSettings settings)
 {
     return(new JsonSerializerOptions
     {
         PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
         DictionaryKeyPolicy = JsonNamingPolicy.CamelCase,
         PropertyNameCaseInsensitive = false,
         WriteIndented = settings.WriteIndented,
         IgnoreNullValues = settings.IgnoreNullValues
     });
 }
Example #3
0
 public HttpPipeWriter(IJsonSerializer serializer, IJsonSerializerSettings settings, IHttpContextAccessor httpContextAccessor)
 {
     _serializer          = serializer;
     _settings            = settings;
     _httpContextAccessor = httpContextAccessor;
 }
Example #4
0
 public JsonSerializer(IJsonSerializerSettings settings)
 {
     _settings = settings;
 }