Пример #1
0
        public ActionResult Create(Blogi blogi)
        {
            blogi.Nimi = User.Identity.Name;
            if (ModelState.IsValid)
            {
                db.Blogit.Add(blogi);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

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