Beispiel #1
0
        //[AuthenticateUser]
        public ActionResult MyBlog(string id)
        {
            string  body = string.Empty;
            MyBlogs blog = new MyBlogs();

            blog.BlogsList = _blogrepo.GetBlogs();
            foreach (var blogDetail in blog.BlogsList)
            {
                using (StreamReader reader = new StreamReader(Server.MapPath("/BlogFiles/Blog_" + blogDetail.Id + ".txt")))
                {
                    body = reader.ReadToEnd();
                }
                blogDetail.BlogBody = body;
            }

            blog.MyBlog = _blogrepo.BlogDetail(id);

            using (StreamReader reader = new StreamReader(Server.MapPath("/BlogFiles/Blog_" + blog.MyBlog.Id + ".txt")))
            {
                body = reader.ReadToEnd();
            }
            blog.MyBlog.BlogBody = body;

            return(View("BlogDetail", blog));
        }