public async Task SaveAsync() { _cacheManager.Remove(QuoteRequestCacheKey, _quoteRequestCacheRegion); var quoteDto = _quoteRequest.ToServiceModel(); if (_quoteRequest.IsTransient()) { await _quoteApi.QuoteModuleCreateAsync(quoteDto); } else { await _quoteApi.QuoteModuleUpdateAsync(quoteDto); } }
public async Task SaveAsync() { _cacheManager.Remove(GetQuoteRequestCacheKey(_quoteRequest.StoreId, _quoteRequest.CustomerId), _quoteRequestCacheRegion); var quoteDto = _quoteRequest.ToServiceModel(); if (_quoteRequest.IsTransient()) { await _quoteApi.QuoteModuleCreateAsync(quoteDto); } else { await _quoteApi.QuoteModuleUpdateAsync(quoteDto); } await _quoteRequestUpdatedEventPublisher.PublishAsync(new QuoteRequestUpdatedEvent(_quoteRequest)); }
public async Task SaveAsync() { QuoteCacheRegion.ExpireQuote(_quoteRequest); var quoteDto = _quoteRequest.ToQuoteRequestDto(); if (_quoteRequest.IsTransient()) { await _quoteApi.CreateAsync(quoteDto); } else { await _quoteApi.UpdateAsync(quoteDto); } await _publisher.Publish(new QuoteRequestUpdatedEvent(_quoteRequest)); }