Ejemplo n.º 1
0
 public static JsonSerializerSettings ConfigureIsoDateTimeConverter(this JsonSerializerSettings settings,
                                                                    Action <GraphiteIsoDateTimeConverter> configure = null)
 {
     settings.RemoveConverters <IsoDateTimeConverter>();
     configure?.Invoke(settings.GetOrAddConverter <GraphiteIsoDateTimeConverter>());
     return(settings);
 }
Ejemplo n.º 2
0
 public static JsonSerializerSettings WriteMicrosoftJsonDateTime(this JsonSerializerSettings settings,
                                                                 Action <KindDateTimeConverter> configure = null)
 {
     settings.DateFormatHandling = DateFormatHandling.MicrosoftDateFormat;
     if (configure != null)
     {
         settings.RemoveConverters <KindDateTimeConverter>();
         configure(settings.GetOrAddConverter <KindDateTimeConverter>());
     }
     return(settings);
 }