public Task UpdateAsync(string key, PromoCode code) { code.Key = key; if (!Validate(code, out var msg)) { throw new PromoCodeValidationException(msg); } return(_codeRepository.UpdateAsync(key, code)); }
public async Task UpdateAsync(string key, PromoCode code) { await _innerRepository.UpdateAsync(key, code); await _distributedCache.SetStringAsync(key, JsonConvert.SerializeObject(code)); }