/// <summary> /// Shows posts of user /// </summary> /// <param name="user">User name</param> /// <param name="page">Current page</param> /// <param name="pageSize">Amount of entries on page</param> /// <returns></returns> public ActionResult UserPosts(string user, int page = 1, int pageSize = 5) { BlogManager db = new BlogManager(); int count = db.GetCountForUser(user); if (count == 0) { return View("UserHaveNoPosts"); } ViewBag.PagesCount = Math.Ceiling((float)count / (float)pageSize); return View(); }