public async Task <ApiPagedListOutput <CommentModel> > GetListAsync([FromQuery] CommentApiListQueryModel model) { var list = await _commentService.GetCommentsPagedListAsync(new CommentListInputModel() { SearchTerm = model.SearchTerm, Limit = model.Limit, Skip = model.Skip, Author = model.Author, Email = model.Email, PostId = model.PostId, Approved = model.Approved, Spam = model.Spam, IncludeOptions = new CommentListIncludeOptions() { IncludePosts = true, }, }); return(new ApiPagedListOutput <CommentModel>(list.TotalCount, list.Select(t => _commentFactory.ToModel(t, new CommentModel())).ToList())); }