This commit is contained in:
2023-10-15 09:51:56 -07:00
parent 2cd2c2b434
commit cd5ab223c9
75 changed files with 895 additions and 722 deletions

View File

@ -1,4 +1,5 @@
using Microsoft.Extensions.Configuration;
using System.Collections.ObjectModel;
using System.Text.Json;
using System.Text.Json.Serialization;
@ -9,6 +10,7 @@ public class AppSettings
public string? Company { get; set; }
public int? MaxDegreeOfParallelism { get; set; }
public string[]? Places { get; set; }
public string? WorkingDirectoryName { get; set; }
public override string ToString()
@ -22,10 +24,13 @@ public class AppSettings
Models.AppSettings result;
if (appSettings?.Company is null) throw new NullReferenceException(nameof(appSettings.Company));
if (appSettings?.MaxDegreeOfParallelism is null) throw new NullReferenceException(nameof(appSettings.MaxDegreeOfParallelism));
// if (appSettings?.Places is null) throw new NullReferenceException(nameof(appSettings.Places));
if (appSettings?.WorkingDirectoryName is null) throw new NullReferenceException(nameof(appSettings.WorkingDirectoryName));
ReadOnlyCollection<Models.Place> places = Place.GetPlaces(appSettings.Places);
result = new(
appSettings.Company,
appSettings.MaxDegreeOfParallelism.Value,
places,
appSettings.WorkingDirectoryName
);
return result;