Beispiel #1
0
        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);
        }
Beispiel #2
0
        public async Task <IEnumerable <CommentViewModel> > Get(CommentsFilterModel filter)
        {
            var comments = await _commentsService.GetComments(map(filter));

            return(comments.Select(map));
        }