Refactor
This commit is contained in:
		| @ -90,9 +90,7 @@ public class AppSettings | ||||
|         Models.AppSettings? results; | ||||
|         string? json; | ||||
|         if (appSettings is null || appSettings.ConfigurationFileName is null) | ||||
|             json = null; | ||||
|         else | ||||
|         { | ||||
|             throw new NotSupportedException($"{nameof(appSettings.ConfigurationFileName)} must be set!"); | ||||
|         string jsonFile = Path.Combine(AppContext.BaseDirectory, appSettings.ConfigurationFileName); | ||||
|         if (File.Exists(jsonFile)) | ||||
|             json = File.ReadAllText(jsonFile); | ||||
| @ -109,7 +107,6 @@ public class AppSettings | ||||
|         } | ||||
|         if (string.IsNullOrEmpty(json) && File.Exists(jsonFile)) | ||||
|             json = File.ReadAllText(jsonFile); | ||||
|         } | ||||
|         results = (string.IsNullOrEmpty(json) ? null : results = JsonSerializer.Deserialize(json, AppSettingsSourceGenerationContext.Default.AppSettings)) ?? | ||||
|             throw new NullReferenceException(nameof(Models.AppSettings)); | ||||
|         results = Get(appSettings, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user