TargetFramework update,

reference updates and added tests for Viewer
This commit is contained in:
2023-01-06 21:17:30 -07:00
parent 791724fdd4
commit f0c2140f93
82 changed files with 10187 additions and 1052 deletions

View File

@ -1,61 +1,24 @@
using System.Text.Json;
using System.Text.Json.Serialization;
namespace OI.Metrology.Archive.Models;
public class AppSettings
public record AppSettings(string ApiLoggingContentTypes,
string ApiLoggingPathPrefixes,
string ApiLogPath,
string AttachmentPath,
string BuildNumber,
string Company,
string ConnectionString,
string GitCommitSeven,
string InboundApiAllowedIPList,
string MonAResource,
string MonASite,
string Oi2SqlConnectionString,
string OIExportPath,
string URLs,
string WorkingDirectoryName)
{
public string ApiLoggingContentTypes { init; get; }
public string ApiLoggingPathPrefixes { init; get; }
public string ApiLogPath { init; get; }
public string AttachmentPath { init; get; }
public string BuildNumber { init; get; }
public string Company { init; get; }
public string ConnectionString { init; get; }
public string GitCommitSeven { init; get; }
public string InboundApiAllowedIPList { init; get; }
public string MonAResource { init; get; }
public string MonASite { init; get; }
public string OIExportPath { init; get; }
public string Oi2SqlConnectionString { init; get; }
public string URLs { init; get; }
public string WorkingDirectoryName { init; get; }
[JsonConstructor]
public AppSettings(string apiLoggingContentTypes,
string apiLoggingPathPrefixes,
string apiLogPath,
string attachmentPath,
string buildNumber,
string company,
string connectionString,
string gitCommitSeven,
string inboundApiAllowedIPList,
string monAResource,
string monASite,
string oi2SqlConnectionString,
string oiExportPath,
string urls,
string workingDirectoryName)
{
ApiLoggingContentTypes = apiLoggingContentTypes;
ApiLoggingPathPrefixes = apiLoggingPathPrefixes;
ApiLogPath = apiLogPath;
AttachmentPath = attachmentPath;
BuildNumber = buildNumber;
Company = company;
ConnectionString = connectionString;
GitCommitSeven = gitCommitSeven;
InboundApiAllowedIPList = inboundApiAllowedIPList;
MonAResource = monAResource;
MonASite = monASite;
Oi2SqlConnectionString = oi2SqlConnectionString;
OIExportPath = oiExportPath;
URLs = urls;
WorkingDirectoryName = workingDirectoryName;
}
public override string ToString()
{
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });

View File

@ -37,6 +37,8 @@ public class AppSettings
private static Models.AppSettings Get(AppSettings appSettings)
{
Models.AppSettings result;
if (appSettings is null)
throw new NullReferenceException(nameof(appSettings));
if (appSettings.ApiLoggingContentTypes is null)
throw new NullReferenceException(nameof(ApiLoggingContentTypes));
if (appSettings.ApiLoggingPathPrefixes is null)