using System.Text.Json; using System.Text.Json.Serialization; namespace OI.Metrology.Viewer.Models; public class AppSettings { protected string _ApiLoggingContentTypes; protected string _ApiLoggingPathPrefixes; protected string _ApiLogPath; protected string _AttachmentPath; protected string _BuildNumber; protected string _Company; protected string _ConnectionString; protected string _GitCommitSeven; protected string _InboundApiAllowedIPList; protected string _MonARessource; protected string _OIExportPath; protected string _URLs; protected string _WorkingDirectoryName; public string ApiLoggingContentTypes => _ApiLoggingContentTypes; public string ApiLoggingPathPrefixes => _ApiLoggingPathPrefixes; public string ApiLogPath => _ApiLogPath; public string AttachmentPath => _AttachmentPath; public string BuildNumber => _BuildNumber; public string Company => _Company; public string ConnectionString => _ConnectionString; public string GitCommitSeven => _GitCommitSeven; public string InboundApiAllowedIPList => _InboundApiAllowedIPList; public string MonARessource => _MonARessource; public string OIExportPath => _OIExportPath; public string URLs => _URLs; public string WorkingDirectoryName => _WorkingDirectoryName; [JsonConstructor] public AppSettings(string apiLoggingContentTypes, string apiLoggingPathPrefixes, string apiLogPath, string attachmentPath, string buildNumber, string company, string connectionString, string gitCommitSeven, string inboundApiAllowedIPList, string monARessource, string oiExportPath, string urls, string workingDirectoryName) { _ApiLoggingContentTypes = apiLoggingContentTypes; _ApiLoggingPathPrefixes = apiLoggingPathPrefixes; _ApiLogPath = apiLogPath; _AttachmentPath = attachmentPath; _BuildNumber = buildNumber; _Company = company; _ConnectionString = connectionString; _GitCommitSeven = gitCommitSeven; _InboundApiAllowedIPList = inboundApiAllowedIPList; _MonARessource = monARessource; _OIExportPath = oiExportPath; _URLs = urls; _WorkingDirectoryName = workingDirectoryName; } public override string ToString() { string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true }); return result; } }