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

            return View(midia);
        }