private static CommentsFilter map(CommentsFilterModel source) { var destination = new CommentsFilter(); destination.PageSize = source.PageSize; destination.PageIndex = source.PageNumber - 1; destination.PostId = source.PostId; destination.StartDate = source.StartDate; destination.EndDate = source.EndDate; return(destination); }
public async Task <IEnumerable <CommentViewModel> > Get(CommentsFilterModel filter) { var comments = await _commentsService.GetComments(map(filter)); return(comments.Select(map)); }