Esempio n. 1
0
        public List <Announce> Get(GetAllAnnouncesFilter filter, PaginationFilter paginationFilter)
        {
            if (paginationFilter is null)
            {
                return(_cleanedAnnounces
                       .AddFiltersOnQuery(filter)
                       .ToList());
            }

            var skip = (paginationFilter.PageNumber - 1) * paginationFilter.PageSize;

            return(_cleanedAnnounces
                   .AddFiltersOnQuery(filter)
                   .Skip(skip)
                   .Limit(paginationFilter.PageSize)
                   .ToList());
        }