public ActionResult Edit(Deal deal) { if (ModelState.IsValid) { db.Entry(deal).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(deal); }
public ActionResult Create(Deal deal) { if (ModelState.IsValid) { deal.DealId = Guid.NewGuid(); db.Deals.Add(deal); db.SaveChanges(); return RedirectToAction("Index"); } return View(deal); }