Exemplo n.º 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));
        }
Exemplo n.º 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));
        }