Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
        public async Task UpdateAsync(string key, PromoCode code)
        {
            await _innerRepository.UpdateAsync(key, code);

            await _distributedCache.SetStringAsync(key, JsonConvert.SerializeObject(code));
        }