Esempio n. 1
0
        public async Task <ActionResult <CountersSetDto> > GetCounters()
        {
            var userId      = _userResolverService.GetUserId();
            var wishedCount = await _wishListService.GetNumberOfWishedBooksAsync(userId);

            var requestedCount = await _requestService.GetNumberOfRequestedBooksAsync(userId);

            var readCount = await _bookService.GetNumberOfBooksInReadStatusAsync(userId);

            var numberOfTimesRegisteredBooksWereRead = await _bookService.GetNumberOfTimesRegisteredBooksWereReadAsync(userId);

            var countersDto = new CountersSetDto()
            {
                WishedBooksCount             = wishedCount,
                RequestedBooksCount          = requestedCount,
                ReadBooksCount               = readCount,
                RegisteredBooksWereReadCount = numberOfTimesRegisteredBooksWereRead
            };

            return(countersDto);
        }