|
@@ -69,7 +69,13 @@ namespace InABox.Configuration
|
|
|
var setting = GetSettings();
|
|
|
|
|
|
if (!string.IsNullOrEmpty(setting.Contents))
|
|
|
+ {
|
|
|
result = Serialization.Deserialize<T>(setting.Contents);
|
|
|
+ if(result is BaseObject obj)
|
|
|
+ {
|
|
|
+ obj.CommitChanges();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
ConfigurationCache.Add(ConfigurationCacheType.Global, Section, result);
|
|
|
return result;
|
|
@@ -89,7 +95,14 @@ namespace InABox.Configuration
|
|
|
new SortOrder<GlobalSettings>(x => x.Key)
|
|
|
);
|
|
|
foreach (var row in data.Rows)
|
|
|
- result[row.Get<GlobalSettings, string>(c => c.Key)] = Serialization.Deserialize<T>(row.Get<GlobalSettings, string>(c => c.Contents));
|
|
|
+ {
|
|
|
+ var tObj = Serialization.Deserialize<T>(row.Get<GlobalSettings, string>(c => c.Contents));
|
|
|
+ if(tObj is BaseObject obj)
|
|
|
+ {
|
|
|
+ obj.CommitChanges();
|
|
|
+ }
|
|
|
+ result[row.Get<GlobalSettings, string>(c => c.Key)] = tObj;
|
|
|
+ }
|
|
|
return result;
|
|
|
}
|
|
|
|