public async Task <IPagedList <Comment> > ListAsync(ICommentFilter filter) { Guard.Against.OutOfRange(filter.Page, Constants.Filter.PageRangeFrom, Constants.Filter.PageRangeTo, Resources.Page_InvalidPageNumber); Guard.Against.OutOfRange(filter.PageSize, Constants.Filter.PageSizeRangeFrom, Constants.Filter.PageSizeRangeTo, Resources.PageSize_InvalidPageSizeNumber); Guard.Against.LessOne(filter.TorrentId, Resources.Torrent_InvalidId_ErrorMessage); var query = _commentRepository.GetAll(x => x.TorrentId == filter.TorrentId) .OrderByDescending(x => x.Likes.Count) .ThenByDescending(x => x.AddedDate); var pagedList = await ApplyFilterAsync(query, filter); Guard.Against.NullNotFound(pagedList.Items, Resources.Comment_NotFoundList_ErrorMessage); return(pagedList); }
public BlogService(IUnitOfWork db, ICommentFilter filter) { _db = db; _filter = filter; }
public CommentService(ISubtextContext context, ICommentFilter filter) { SubtextContext = context; Filter = filter; }
public CommentService(ISubtextContext context, ICommentFilter filter) { SubtextContext = context; Filter = filter; }