예제 #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));
 }
예제 #2
0
        public async Task UpdateAsync(string key, PromoCode code)
        {
            await _innerRepository.UpdateAsync(key, code);

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