Beispiel #1
0
        public UrlsApiDto GetUrlsByTestId(int testId, int page, int amountUrlsPerPage)
        {
            var urls = urlRepository.GetPageWithAmount(filter: u => u.TestId == testId, page: page, amountPerPage: amountUrlsPerPage);

            return(new UrlsApiDto
            {
                Urls = mapper.Map <List <UrlDto> >(urls),
                TotalCount = urlRepository.Count(predicate: u => u.TestId == testId)
            });
        }
Beispiel #2
0
        public UrlsApiDto GetUrls(int page, int amountUrlsPerPage, string userEmail)
        {
            var urls = urlRepository.GetPageWithAmount(filter: u => u.Test.Author.Email == userEmail, page: page, amountPerPage: amountUrlsPerPage);

            return(new UrlsApiDto
            {
                Urls = mapper.Map <List <UrlDto> >(urls),
                TotalCount = urlRepository.Count(u => u.Test.Author.Email == userEmail)
            });
        }