예제 #1
0
        public async Task <IActionResult> PutQuoteModel([FromRoute] string id, [FromBody] QuoteModel quoteModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != quoteModel.Id)
            {
                return(BadRequest());
            }

            try
            {
                var reult = _quoteService.PutOne(id, quoteModel);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_quoteService.Exists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }