Moved all of the file paths to appsettings file.

This commit is contained in:
Daniel Wathen
2023-01-19 13:05:54 -07:00
parent 7d2eb5ef0f
commit afdd487b7d
7 changed files with 28 additions and 22 deletions

View File

@ -18,6 +18,7 @@ public class AppSettings
[Display(Name = "Is Staging"), Required] public bool? IsStaging { get; set; }
[Display(Name = "MonA Resource"), Required] public string MonAResource { get; set; }
[Display(Name = "MonA Site"), Required] public string MonASite { get; set; }
[Display(Name = "SLL File Path"), Required] public string SLLFilePath { get; set; }
[Display(Name = "Tool State Owner File Path"), Required] public string ToolStateOwnerFilePath { get; set; }
#nullable enable
@ -53,6 +54,8 @@ public class AppSettings
throw new NullReferenceException(nameof(MonAResource));
if (appSettings.MonASite is null)
throw new NullReferenceException(nameof(MonASite));
if (appSettings.SLLFilePath is null)
throw new NullReferenceException(nameof(SLLFilePath));
if (appSettings.ToolStateOwnerFilePath is null)
throw new NullReferenceException(nameof(ToolStateOwnerFilePath));
result = new(
@ -66,6 +69,7 @@ public class AppSettings
appSettings.IsStaging.Value,
appSettings.MonAResource,
appSettings.MonASite,
appSettings.SLLFilePath,
appSettings.ToolStateOwnerFilePath);
return result;
}