public ActionResult Edit([Bind(Include = "ArtistID, ArtistName, ArtistBio, ImageSrc, ImageAlt")] tblArtist artist) { if (ModelState.IsValid) { context.Entry(artist).State = EntityState.Modified; context.SaveChanges(); return(RedirectToAction("AdminIndex")); } else { return(View(artist)); } }
public ActionResult Edit([Bind(Include = "GenreID, GenreName, GenreBio, ImageSrc, ImageAlt")] tblGenre genre) { if (ModelState.IsValid) { context.Entry(genre).State = EntityState.Modified; context.SaveChanges(); return(RedirectToAction("AdminIndex")); } else { return(View()); } }
public ActionResult Edit([Bind(Include = "RecordID, RecordName, RecordBio, ReleaseDate, ArtistSelected, GenreSelected, ImageSrc, ImageAlt")] tblRecord record, EditViewModel view) { if (ModelState.IsValid) { record.ArtistID = int.Parse(view.ArtistSelected); record.GenreID = int.Parse(view.GenreSelected); context.Entry(record).State = EntityState.Modified; context.SaveChanges(); return(RedirectToAction("AdminIndex")); } else { return(View()); } }