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

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