public async Task <HttpClaimGenerator> QueryByName(string name) { return(await _kvcacheVisitor.Get( async (k) => { return await _httpClaimGeneratorRepository.QueryByName(name); }, name )); }
public async Task <HttpClaimGenerator> QueryByName(string name) { CacheTimeContainer <HttpClaimGenerator> generatorItem = _generatorsByName.GetValue(name); if (generatorItem == null || generatorItem.Expire()) { var generator = await _httpClaimGeneratorRepository.QueryByName(name); generatorItem = new CacheTimeContainer <HttpClaimGenerator>(generator, CacheTimeout); _generatorsByName.SetValue(name, generatorItem); } return(generatorItem.Value); }