public ActionResult Edit([Bind(Include = "GenreId,Name,Description")] Genre genre) { if (ModelState.IsValid) { db.Entry(genre).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(genre)); }
public ActionResult Edit([Bind(Include = "Id,Name,Artist,Year,Rating, ImgUrl")] Albums albums) { if (ModelState.IsValid) { db.Entry(albums).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(albums)); }
public ActionResult Edit([Bind(Include = "ArtistId,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 = "AlbumInfoId,GenreId,ArtistId,Title,Price,AlbumArtUrl")] AlbumInfo albuminfo) { if (ModelState.IsValid) { _db.Entry(albuminfo).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ArtistId = new SelectList(_db.Artists, "ArtistId", "Name", albuminfo.ArtistId); ViewBag.GenreId = new SelectList(_db.Genres, "GenreId", "Name", albuminfo.GenreId); return(View(albuminfo)); }
public ActionResult Edit([Bind(Include = "AlbumId,GenreId,ArtistId,Titel,Price")] Album album) { if (ModelState.IsValid) { db.Entry(album).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ArtistId = new SelectList(db.Artists, "ArtistId", "Name", album.ArtistId); ViewBag.GenreId = new SelectList(db.Genres, "GenreId", "Name", album.GenreId); return(View(album)); }