Exemplo n.º 1
0
        public ActionResult Create(Country country)
        {
            if (ModelState.IsValid)
            {
                db.Country.Add(country);
                db.SaveChanges();
                return RedirectToAction("Details", new { id = country.ID });
            }

            return View(country);
        }
Exemplo n.º 2
0
 public ActionResult Edit(Country country)
 {
     if (ModelState.IsValid)
     {
         db.Entry(country).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Details", new { id = country.ID });
     }
     return View(country);
 }