2013-02-23 21:35:26 +01:00
|
|
|
|
using System.Linq;
|
2013-01-25 20:03:28 +01:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Newtonsoft.Json.Serialization;
|
|
|
|
|
|
2013-02-23 21:35:26 +01:00
|
|
|
|
namespace NzbDrone.Api.Extensions
|
2013-01-25 20:03:28 +01:00
|
|
|
|
{
|
|
|
|
|
public static class Serializer
|
|
|
|
|
{
|
|
|
|
|
static Serializer()
|
|
|
|
|
{
|
|
|
|
|
Settings = new JsonSerializerSettings
|
|
|
|
|
{
|
|
|
|
|
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
|
|
|
|
|
NullValueHandling = NullValueHandling.Ignore,
|
2013-02-15 07:46:42 +01:00
|
|
|
|
Formatting = Formatting.Indented,
|
2013-01-25 20:03:28 +01:00
|
|
|
|
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Instance = new JsonSerializer
|
|
|
|
|
{
|
|
|
|
|
DateTimeZoneHandling = Settings.DateTimeZoneHandling,
|
|
|
|
|
NullValueHandling = NullValueHandling.Ignore,
|
2013-02-15 07:46:42 +01:00
|
|
|
|
Formatting = Formatting.Indented,
|
2013-01-25 20:03:28 +01:00
|
|
|
|
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate,
|
|
|
|
|
ContractResolver = new CamelCasePropertyNamesContractResolver()
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static JsonSerializerSettings Settings { get; private set; }
|
|
|
|
|
|
|
|
|
|
public static JsonSerializer Instance { get; private set; }
|
|
|
|
|
}
|
|
|
|
|
}
|