This commit is contained in:
2021-09-06 23:09:12 +00:00
parent 5ff995ff22
commit 2d2b13cf00
4 changed files with 18 additions and 24 deletions

View File

@@ -12,14 +12,16 @@ namespace AyaNova.Util
/// </summary>
internal static class ServerGlobalBizSettings
{
internal static GlobalBizSettings Cache {get;set;}
internal static GlobalBizSettings Cache { get; set; }
/// <summary>
/// Populate and / or create the settings
/// </summary>
internal static void Initialize(GlobalBizSettings global, AyContext ct = null)
internal static void Initialize(GlobalBizSettings global, AyContext ct)
{
if (global == null)
{
{
//fetch or create as not provided (meaning this was called from Startup.cs)
global = ct.GlobalBizSettings.FirstOrDefault(z => z.Id == 1);
if (global == null)
@@ -29,7 +31,7 @@ namespace AyaNova.Util
ct.SaveChanges();
}
}
Cache = global;
Cache = global;
}
}//eoc
}//eons