public ActionResult AddMyTitle() { TitleManiViewModel model = new TitleManiViewModel { Title = new Title() }; return(View(model)); }
public ActionResult AddMyTitle(Title title) { if (!ModelState.IsValid) { TitleManiViewModel model = new TitleManiViewModel { Title = new Title() }; return(View(model)); } _db.Entry(title).State = System.Data.Entity.EntityState.Added; _db.SaveChanges(); TempData["message"] = "Veri eklendi"; return(RedirectToAction("ListMyTitles")); }