Beispiel #1
0
 public static IJsonOptions Configure(this IJsonOptions options, Action <JsonSerializerSettings> action)
 {
     if (action == null)
     {
         throw new ArgumentNullException(nameof(action));
     }
     return(new ChainedJsonOptions(options, action));
 }
Beispiel #2
0
        public JsonSerializer(IJsonOptions options = null)
        {
            options?.Apply(_settingsIndented);
            options?.Apply(_settingsNotIndented);

            _settingsIndented.Formatting    = Formatting.Indented;
            _settingsNotIndented.Formatting = Formatting.None;
        }
Beispiel #3
0
 public void SetUp()
 {
     _server = new TestServer(new WebHostBuilder()
                              .UseStartup <Startup>());
     _client      = _server.CreateClient();
     _log         = new ConsoleLog();
     _jsonOptions = GetService <IJsonOptions>();
     _eventStore  = GetService <IEventStore>();
 }
Beispiel #4
0
 public ChainedJsonOptions(IJsonOptions parent, Action <JsonSerializerSettings> action)
 {
     _parent = parent;
     _action = action;
 }
Beispiel #5
0
 public static IJsonOptions AddConverter <T>(this IJsonOptions options)
     where T : JsonConverter, new()
 {
     return(options.Configure(s => s.Converters.Insert(0, new T())));
 }
Beispiel #6
0
 public static IJsonOptions AddSingleValueObjects(this IJsonOptions options)
 {
     return(options.AddConverter <SingleValueObjectConverter>());
 }
Beispiel #7
0
 public EventFlowJsonOptionsMvcConfiguration(IJsonOptions jsonOptions)
 {
     _jsonOptions = jsonOptions;
 }