예제 #1
0
        public async Task <IActionResult> Index()
        {
            var books = await _bookCatalog.GetBooks();

            // TODO Hier die anderen Services ansprechen

            var bookCatalogVm = BuildBookCatalogVm(books);

            return(View(bookCatalogVm));
        }
예제 #2
0
        public async Task <IActionResult> Index()
        {
            var books = await _bookCatalog.GetBooks();

            // TODO: Aus Performance gründen könnten diese zwei Requests parallel laufen
            var prices = await _priceService.GetPricesForBooks(books);

            var ratings = await _ratingService.GetRatingsForBooks(books);

            var bookCatalogVm = BuildBookCatalogVm(books, prices, ratings);

            return(View(bookCatalogVm));
        }