mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-27 01:57:21 +00:00
33 lines
No EOL
1.2 KiB
C#
33 lines
No EOL
1.2 KiB
C#
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.None,
|
|
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate
|
|
};
|
|
|
|
Instance = new JsonSerializer
|
|
{
|
|
DateTimeZoneHandling = Settings.DateTimeZoneHandling,
|
|
NullValueHandling = NullValueHandling.Ignore,
|
|
Formatting = Formatting.None,
|
|
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate,
|
|
ContractResolver = new CamelCasePropertyNamesContractResolver()
|
|
};
|
|
}
|
|
|
|
public static JsonSerializerSettings Settings { get; private set; }
|
|
|
|
public static JsonSerializer Instance { get; private set; }
|
|
}
|
|
} |