You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/NzbDrone.Api/Extentions/Serializer.cs

33 lines
1.2 KiB

using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace NzbDrone.Api.Extentions
{
public static class Serializer
{
static Serializer()
{
Settings = new JsonSerializerSettings
{
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
NullValueHandling = NullValueHandling.Ignore,
Formatting = Formatting.Indented,
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate
};
Instance = new JsonSerializer
{
DateTimeZoneHandling = Settings.DateTimeZoneHandling,
NullValueHandling = NullValueHandling.Ignore,
Formatting = Formatting.Indented,
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate,
ContractResolver = new CamelCasePropertyNamesContractResolver()
};
}
public static JsonSerializerSettings Settings { get; private set; }
public static JsonSerializer Instance { get; private set; }
}
}