aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests/Helpers/CommonJsonSerializeOptions.cs
blob: a7d6d01f5366024c6bed4a0ea6c32391aae8002e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System.Text.Json;
using System.Text.Json.Serialization;
using Timeline.Models.Converters;

namespace Timeline.Tests.Helpers
{
    public static class CommonJsonSerializeOptions
    {
        public static JsonSerializerOptions Options { get; }

        static CommonJsonSerializeOptions()
        {
            Options = new JsonSerializerOptions
            {
                PropertyNamingPolicy = JsonNamingPolicy.CamelCase
            };
            Options.Converters.Add(new JsonStringEnumConverter());
            Options.Converters.Add(new JsonDateTimeConverter());
        }
    }
}