public ViewResult Details(int id) { var model = new NewsFeed(); model = _dataContext.NewsFeedItemValues.Find(id); return View(model); }
public ActionResult Create(NewsFeed newsFeed) { if (ModelState.IsValid) { _dataContext.NewsFeedItemValues.Add(newsFeed); _dataContext.SaveChanges(); return RedirectToAction("Index"); } return View(newsFeed); }
public ActionResult Edit(NewsFeed newsFeed) { if (ModelState.IsValid) { _dataContext.Entry(newsFeed).State = EntityState.Modified; _dataContext.SaveChanges(); return RedirectToAction("Index"); } return View(newsFeed); }