public ActionResult Index(ObjectId Id, string comment) { var helper = new MongoNewsHelper(); helper.PostComment(Id, comment); return(RedirectToAction("Index", "Home")); }
public ActionResult Index() { var helper = new MongoNewsHelper(); var someNews = helper.GetNews(5); return(View(someNews)); }
public ActionResult Add(HttpPostedFileBase upload, Post post) { if (upload != null && upload.ContentLength > 0) { using (var reader = new System.IO.BinaryReader(upload.InputStream)) { post.image = reader.ReadBytes(upload.ContentLength); } } if (post.comments == null) { post.comments = new List <string>(); } var helper = new MongoNewsHelper(); helper.PostPost(post); return(RedirectToAction("Index", "Home")); }