Пример #1
0
 public ActionResult Edit(Interest interest)
 {
     if (ModelState.IsValid)
     {
         context.Entry(interest).State = EntityState.Modified;
         context.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(interest);
 }
Пример #2
0
        public ActionResult Create(Interest interest)
        {
            if (ModelState.IsValid)
            {
                context.Interests.Add(interest);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(interest);
        }