Beispiel #1
0
        public ActionResult Index(ObjectId Id, string comment)
        {
            var helper = new MongoNewsHelper();

            helper.PostComment(Id, comment);
            return(RedirectToAction("Index", "Home"));
        }
Beispiel #2
0
        public ActionResult Index()
        {
            var helper   = new MongoNewsHelper();
            var someNews = helper.GetNews(5);

            return(View(someNews));
        }
Beispiel #3
0
        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"));
        }