Esempio n. 1
0
        public async Task <IActionResult> PutListing(int id, Listing listing)
        {
            if (id != listing.ID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }