예제 #1
0
        // GET: /Home/
        public async Task <IActionResult> Index([FromServices] GetTopAlbums topAlbumsCommand)
        {
            _logger.LogTrace("Loading home page");
            List <Model.Album> albums = await topAlbumsCommand.GetTopSellingAlbumsAsync(6);

            if (topAlbumsCommand.IsFailedExecution)
            {
                _logger.LogError(topAlbumsCommand.ExecutionException, "Failed to get top albums");
            }

            _logger.LogDebug("Circuit breaker execution time {responseTime}", topAlbumsCommand.ExecutionTimeInMilliseconds);

            _logger.LogInformation("Circuit breaker response recieved");
            return(View(albums));
        }
예제 #2
0
        // GET: /Home/
        public async Task <IActionResult> Index([FromServices] GetTopAlbums topAlbumsCommand)
        {
            List <Model.Album> albums = await topAlbumsCommand.GetTopSellingAlbumsAsync(6);

            return(View(albums));
        }