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); }
public ActionResult Edit(Blogi blogi) { if (ModelState.IsValid) { db.Entry(blogi).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(blogi); }