示例#1
0
        public IActionResult Detail(int id)
        {
            ViewBag.BookReviewed = id;
            List <Review> Reviews = ReviewRepo.GetReviewsByBookID(id);
            BookViewModel VM      = BookConverter.BookToBookViewModel(BookRepo.GetBookByID(id));

            foreach (Review R in Reviews)
            {
                VM.Reviews.Add(ReviewConverter.ReviewToReviewViewModel(R));
            }
            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));
        }
示例#3
0
        public IActionResult Detail(int id)
        {
            ReviewViewModel VM = Converter.ReviewToReviewViewModel(Repo.GetReviewByID(id));

            return(View(VM));
        }