Exemplo n.º 1
0
 public ActionResult Edit(Interest interest)
 {
     if (ModelState.IsValid)
     {
         context.Entry(interest).State = EntityState.Modified;
         context.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(interest);
 }
Exemplo n.º 2
0
        public ActionResult Create(Interest interest)
        {
            if (ModelState.IsValid)
            {
                context.Interests.Add(interest);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(interest);
        }