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()); }
public ActionResult Edit([Bind(Include = "ItemID,ItemSKU,Title,CategoryType,Price,Condition,HandlingTime,Duration,Format,PictureURL,Quantity,ProductDescription")] eBayItem eBayItem) { if (ModelState.IsValid) { db.Entry(eBayItem).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(eBayItem)); }