Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "ID,ArtistID,Name")] Track track)
 {
     if (ModelState.IsValid)
     {
         db.Entry(track).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ArtistID = new SelectList(db.Artists, "ID", "Name", track.ArtistID);
     return(View(track));
 }