public ActionResult Edit([Bind(Include = "Artist_OneTowManyID,Name")] Artist_OneTowMany artist_OneTowMany) { if (ModelState.IsValid) { db.Entry(artist_OneTowMany).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(artist_OneTowMany)); }
public ActionResult Edit([Bind(Include = "AlbumID,Name,ReleaseDate,Rating,IsEnable")] Album album) { if (ModelState.IsValid) { db.Entry(album).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(album)); }
public ActionResult Edit([Bind(Include = "UserID,UserName,FirstName,LastName,Password,Role,IsEnable,CreateDate,CreateBy,UpdateDate,UpdateBy")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Edit([Bind(Include = "ArtistID,Name")] Artist artist) { if (ModelState.IsValid) { db.Entry(artist).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ArtistID = new SelectList(db.ArtistDetails, "ArtistID", "Bio", artist.ArtistID); return(View(artist)); }
public ActionResult Edit([Bind(Include = "ID,AlbumId,AuthorId,CreateDate")] AlbumAuthor albumAuthor) { if (ModelState.IsValid) { db.Entry(albumAuthor).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AlbumId = new SelectList(db.Album, "AlbumID", "Name", albumAuthor.AlbumId); ViewBag.AuthorId = new SelectList(db.Author, "AuthorID", "Name", albumAuthor.AuthorId); return(View(albumAuthor)); }
public virtual void Update(T entity) { context.Entry <T>(entity).State = EntityState.Modified; }