using System.Text.Json; using System.Text.Json.Serialization; using LootDumpProcessor.Serializers.Json.Converters; namespace LootDumpProcessor.Serializers.Json; public class NetJsonSerializer : IJsonSerializer { private static JsonSerializerOptions _serializeOptions = new() { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, Converters = { new NetJsonKeyConverter(), new JsonStringEnumConverter(), new NetDateTimeConverter() } }; public string Serialize(T obj) { return JsonSerializer.Serialize(obj, _serializeOptions); } public T Deserialize(string obj) { return JsonSerializer.Deserialize(obj, _serializeOptions); } }