public async Task SaveAsync() { _cacheManager.Remove(GetQuoteRequestCacheKey(_quoteRequest.StoreId, _quoteRequest.CustomerId), _quoteRequestCacheRegion); var quoteDto = _quoteRequest.ToQuoteRequestDto(); if (_quoteRequest.IsTransient()) { await _quoteApi.QuoteModule.CreateAsync(quoteDto); } else { await _quoteApi.QuoteModule.UpdateAsync(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)); }