예제 #1
0
        public ViewResult Details(int id)
        {
            var model = new NewsFeed();

            model = _dataContext.NewsFeedItemValues.Find(id);

            return View(model);
        }
예제 #2
0
        public ActionResult Create(NewsFeed newsFeed)
        {
            if (ModelState.IsValid)
            {
                _dataContext.NewsFeedItemValues.Add(newsFeed);
                _dataContext.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(newsFeed);
        }
예제 #3
0
        public ActionResult Edit(NewsFeed newsFeed)
        {
            if (ModelState.IsValid)
            {
                _dataContext.Entry(newsFeed).State = EntityState.Modified;
                _dataContext.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(newsFeed);
        }