示例#1
0
        public ActionResult Create(Studenti studenti)
        {
            if (ModelState.IsValid)
            {
                db.Studenti.Add(studenti);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(studenti);
        }
示例#2
0
 public ActionResult Edit(Studenti studenti)
 {
     if (ModelState.IsValid)
     {
         db.Entry(studenti).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(studenti);
 }