示例#1
0
        public async Task <IActionResult> PutDealership(int id, Dealership dealership)
        {
            if (id != dealership.Id)
            {
                return(BadRequest());
            }

            _context.Entry(dealership).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DealershipExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }