Removed Configuration.SetAndUpdate

This commit is contained in:
2023-08-12 10:45:38 -07:00
parent 2f5d309ed1
commit 1c5a2f1d93
57 changed files with 1065 additions and 1542 deletions

View File

@ -7,13 +7,9 @@ namespace View_by_Distance.Instance.Models.Binder;
public class AppSettings
{
#nullable disable
public string Company { get; set; }
public string? Company { get; set; }
public int? MaxDegreeOfParallelism { get; set; }
public string WorkingDirectoryName { get; set; }
#nullable restore
public string? WorkingDirectoryName { get; set; }
public override string ToString()
{
@ -24,8 +20,9 @@ public class AppSettings
private static Models.AppSettings Get(AppSettings? appSettings)
{
Models.AppSettings result;
if (appSettings?.MaxDegreeOfParallelism is null)
throw new NullReferenceException(nameof(appSettings.MaxDegreeOfParallelism));
if (appSettings?.Company is null) throw new NullReferenceException(nameof(appSettings.Company));
if (appSettings?.MaxDegreeOfParallelism is null) throw new NullReferenceException(nameof(appSettings.MaxDegreeOfParallelism));
if (appSettings?.WorkingDirectoryName is null) throw new NullReferenceException(nameof(appSettings.WorkingDirectoryName));
result = new(
appSettings.Company,
appSettings.MaxDegreeOfParallelism.Value,