コード例 #1
0
        public async Task <ActionResult> Index()
        {
            string customerId  = IdentityHelper.CurrentUserId;
            var    creditCards = await _creditCardService.GetAllCreditCardsAsync(customerId);

            return(View(creditCards));
        }
コード例 #2
0
        // 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));
        }