示例#1
0
 private void MockData()
 {
     _countersSetDto = new CountersSetDto()
     {
         RequestedBooksCount          = 5,
         ReadBooksCount               = 4,
         WishedBooksCount             = 1,
         RegisteredBooksWereReadCount = 0
     };
 }
示例#2
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);
        }