public IActionResult Index() { string userId = userManager.GetUserId(User); try { var customer = customerService.GetCustomerFromUserId(userId); var bankAccounts = accountsService.GetCustomerBankAccounts(userId); var cards = cardService.GetCardsForCustomer(userId); CompleteCardsViewModel cardList = new CompleteCardsViewModel(); cardList.Cards = new List <CardWithColorViewModel>(); foreach (var card in cards) { CardWithColorViewModel temp = new CardWithColorViewModel(); temp.Card = card; temp.CardColor = metaDataService.GetMetaDataForCard(card.Id); cardList.Cards.Add(temp); } return(View(cardList)); } catch (Exception e) { logger.LogDebug("Failed to retrieve cards list {@Exception}", e); logger.LogError("Failed to retrieve cards list {ExceptionMessage}", e.Message); return(BadRequest("Unable to process your request")); } }