Пример #1
0
        public ActionResult Create(Loot loot)
        {
            if (ModelState.IsValid)
            {
                db.Loots.Add(loot);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(loot);
        }
Пример #2
0
        public ActionResult Edit(Loot loot)
        {
            if (ModelState.IsValid)
            {
                db.Entry(loot).State = EntityState.Modified;
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(loot);
        }