public PartialViewResult list(int count = 10, int offset = 0) { return(PartialView(postService.GetLastPosts(count, offset * count).Select(post => new PostViewModel() { Text = post.Text, Id = post.PostId, UserName = userService.Get(post.UserId).Email } ))); }
public PartialViewResult List() { int postid = Convert.ToInt32(RouteData.Values["id"]); var comments = commentService.GetAll().Where(comm => comm.PostId.Equals(postid)).Select(comm => new Blog1.Models.CommentViewModel() { Id = comm.CommentId, Text = comm.commentText, User = userService.Get(comm.UserId).Email }); return(PartialView(comments)); }