public async Task Delete(string name, string providerName, string providerKey) { LinSetting setting = await _settingRepository.FindAsync(name, providerName, providerKey);; if (setting != null) { await _settingRepository.DeleteAsync(setting.Id); } }
public async Task SetAsync() { var setting = await _settingRepository.FindAsync(_testData.SettingId).ConfigureAwait(false); setting.Value.ShouldBe("42"); await _settingManagementStore.SetAsync("MySetting1", "43", GlobalSettingValueProvider.ProviderName, null).ConfigureAwait(false); (await _settingRepository.FindAsync(_testData.SettingId).ConfigureAwait(false)).Value.ShouldBe("43"); }
public async Task Cache_Should_Invalidator_WhenSettingChanged() { // Arrange // GetOrNullAsync will cache language. await _settingManagementStore.GetOrNullAsync("MySetting2", UserSettingValueProvider.ProviderName, _testData.User1Id.ToString()); // Act var lang = await _settingRepository.FindAsync("MySetting2", UserSettingValueProvider.ProviderName, _testData.User1Id.ToString()); await _settingRepository.DeleteAsync(lang); // Assert (await _cache.GetAsync( SettingCacheItem.CalculateCacheKey("MySetting2", UserSettingValueProvider.ProviderName, _testData.User1Id.ToString()))).ShouldBeNull(); }
public async Task <string> GetOrNullAsync(string name, string providerName, string providerKey) { var setting = await _settingRepository.FindAsync(name, providerName, providerKey); return(setting?.Value); }