Пример #1
0
        public IActionResult Index()
        {
            List <Book>       Books = BookRepo.GetAllBooks();
            BookListViewModel VM    = new BookListViewModel();

            foreach (Book B in Books)
            {
                VM.Books.Add(BookConverter.BookToBookViewModel(B));
            }
            return(View(VM));
        }
Пример #2
0
        public IActionResult Index()
        {
            int               id      = Convert.ToInt32(this.User.FindFirstValue(ClaimTypes.NameIdentifier));
            List <Book>       Books   = BookRepo.GetUserBacklog(id);
            List <Review>     Reviews = ReviewRepo.GetAllReviewsByUserID(id);
            OverviewViewModel VM      = new OverviewViewModel();

            foreach (Book B in Books)
            {
                VM.UserBacklog.Books.Add(BookConverter.BookToBookViewModel(B));
            }
            foreach (Review R in Reviews)
            {
                VM.UserReviews.Reviews.Add(ReviewConverter.ReviewToReviewViewModel(R));
            }
            return(View(VM));
        }