public void AddOrUpdate <T>(string project, string name, T value) { DataProvider.AddOrUpdate(new SettingsModel <T>() { Key = name, Value = value }, project, x => x.Key == name); CacheProvider.AddOrUpdate(project + name, value); }
public T GetValue <T>(string project, string name) { var cacheResult = CacheProvider.GetValue <T>(project + name); if (cacheResult.Result == CacheResultEnum.Found) { return(cacheResult.Item); } var item = DataProvider.GetValue <SettingsModel <T> >(x => x.Key == name, project); if (item == null) { throw new SettingsNotFoundException(name, project); } CacheProvider.AddOrUpdate(project + name, item.Value); return(item.Value); }