public ActionResult Create(Song song) { if (ModelState.IsValid) { song.Id = Guid.NewGuid(); db.Songs.Add(song); db.SaveChanges(); return RedirectToAction("Index"); } return View(song); }
public ActionResult Edit(Song song) { if (ModelState.IsValid) { db.Entry(song).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(song); }