public async Task <ActionResult> Index() { string customerId = IdentityHelper.CurrentUserId; var creditCards = await _creditCardService.GetAllCreditCardsAsync(customerId); return(View(creditCards)); }
// GET: Deposit public async Task <ActionResult> Index() { DepositRequestModel depositRequest = new DepositRequestModel(); var cardsFromDb = await _creditCardService.GetAllCreditCardsAsync(IdentityHelper.CurrentUserId); foreach (CreditCardViewModel creditCard in cardsFromDb) { depositRequest.CreditCardItems.Add( new SelectListItem { Value = creditCard.Id.ToString(), Text = $"Card Number: {creditCard.Number}" } ); } return(View(depositRequest)); }