public ActionResult NewsEdit(NewsViewModel model)
 {
     if (ModelState.IsValid)
     {
         using (var c = new WebDbContext())
         {
             var oPost = c.News.Find(model.Id);
             oPost.HtmlContent = model.HtmlContent;
             oPost.Image = model.ImageFile;
             oPost.Title = model.Title;
             oPost.Date = DateTime.Now;
             c.SaveChanges();
         }
         GameCache.ReCache(false, false, true);
         return RedirectToAction("NewsList");
     }
     return View(model);
 }
 public ActionResult NewsCreate(NewsViewModel model)
 {
     if (ModelState.IsValid)
     {
         NewsPost npost = new NewsPost();
         npost.Date = DateTime.Now;
         npost.Title = model.Title;
         npost.Image = model.ImageFile;
         npost.Shares = 0;
         npost.HtmlContent = model.HtmlContent;
         npost.Author = "Admin";
         using (var c = new WebDbContext())
         {
             c.News.Add(npost);
             c.SaveChanges();
         }
         GameCache.ReCache(false, false, true);
     }
     
     return RedirectToAction("NewsList","Admin");
 }
 public ActionResult NewsDelete(int id)
 {
     using (var c = new WebDbContext())
     {
         c.News.Remove(c.News.Find(id));
         c.SaveChanges();
     }
     GameCache.ReCache(false, false, true);
     return RedirectToAction("NewsList");
 }