using System.Text.Encodings.Web; using System.Text.Json; using System.Text.Json.Serialization; namespace Schaad.Accounting.Repositories { /// /// Serializer settings shared by the repositories and the XML-to-JSON migration, so both /// produce byte-identical files. /// public static class JsonStorage { public static readonly JsonSerializerOptions Options = new() { // Human readable: indented, and umlauts/quotes written as-is instead of \u escapes. WriteIndented = true, Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, PropertyNameCaseInsensitive = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull }; } }