コード例 #1
0
        public async Task <IActionResult> Quote([FromBody] QuoteRequest request)
        {
            var quote = request.ToQuote();

            BadRequestObjectResult error = CheckConsistency(quote);

            if (error != null)
            {
                return(error);
            }

            _quoteRepo.Add(quote);

            quote.SetCustomer(await _customerRepo.Put(quote.Customer));

            quote.SetStatusAsRequested();

            await _unitOfWork.SaveChangesAsync();

            CacheRequest(quote);

            return(Ok(quote.Id));
        }