public ActionResult MyBlogs() { Users user = JsonConvert.DeserializeObject <Users>(Convert.ToString(Session["User"])); var myblogs = _blogrepo.GetMyBlogs(user); foreach (var blog in myblogs) { var body = ""; using (StreamReader reader = new StreamReader(Server.MapPath("/BlogFiles/Blog_" + blog.Id + ".txt"))) { body = reader.ReadToEnd(); } blog.BlogBody = body; } return(View(myblogs)); }