public async Task <ActionResult <CommentSearchViewModel> > Search(string searchTerm, PagingParams pagingParams) { var comments = await Mediator.Send(new GetCommentsBySearchQuery(searchTerm, pagingParams)); var model = new CommentSearchViewModel { SearchTerm = searchTerm, CommentPage = new FrontendPage <GetCommentModel>(comments) }; return(View(model)); }
public async Task <IActionResult> List(CommentSearchViewModel model) { var result = await _service.Search(model.ToSearchModel()); return(PartialView("_List", result)); }