public async Task <IActionResult> PutComicItem(long id, ComicItem comicItem) { if (id != comicItem.Id) { return(BadRequest()); } _context.Entry(comicItem).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ComicItemExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void Edit(ComicBook comicbook) { if (ModelState.IsValid) { db.Entry(comicbook).State = EntityState.Modified; db.SaveChanges(); } }
public ActionResult Edit(Publisher publisher) { if (ModelState.IsValid) { db.Entry(publisher).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(publisher)); }
public ActionResult Edit([Bind(Include = "ID,strTitle,iIssueNumber,strSeries,strPublisher,strAuthor,strArtist,iYearPublished")] Comic comic) { if (ModelState.IsValid) { db.Entry(comic).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(comic)); }
public ActionResult Edit([Bind(Include = "Id,Name")] Artist artist) { if (ModelState.IsValid) { db.Entry(artist).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(artist)); }
public ActionResult Edit([Bind(Include = "Id,Title,Description")] Series series) { if (ModelState.IsValid) { db.Entry(series).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(series)); }
public ActionResult Edit([Bind(Include = "Id,SeriesId,IssueNumber,Description,PublishedOn,AverageRating")] ComicBook comicbook) { if (ModelState.IsValid) { db.Entry(comicbook).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SeriesId = new SelectList(db.Series, "Id", "Title", comicbook.SeriesId); return(View(comicbook)); }
public ActionResult Edit([Bind(Include = "Id,ComicBookId,ArtistId,RoleId")] ComicBookArtist comicbookartist) { if (ModelState.IsValid) { db.Entry(comicbookartist).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ArtistId = new SelectList(db.Artists, "Id", "Name", comicbookartist.ArtistId); ViewBag.ComicBookId = new SelectList(db.ComicBooks, "Id", "Description", comicbookartist.ComicBookId); ViewBag.RoleId = new SelectList(db.Roles, "Id", "Name", comicbookartist.RoleId); return(View(comicbookartist)); }