Пример #1
0
 public ActionResult Edit(Deal deal)
 {
     if (ModelState.IsValid)
     {
         db.Entry(deal).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(deal);
 }
Пример #2
0
        public ActionResult Create(Deal deal)
        {
            if (ModelState.IsValid)
            {
                deal.DealId = Guid.NewGuid();
                db.Deals.Add(deal);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(deal);
        }