public JsonResult BankList()
        {
            var banks = _brandQueries.GetBrands().Select(brand => brand.Id).ToList()
                        .SelectMany(brandId => _paymentQueries.GetBanksByBrand(brandId)).Distinct()
                        .OrderBy(bank => bank.BankName)
                        .Select(bank => bank.BankName);

            return(Json(banks, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public IEnumerable <BankResponse> GetBanks()
        {
            var player = _paymentQueries.GetPlayerWithBank(PlayerId);

            if (player == null)
            {
                throw new RegoException(ErrorMessagesEnum.ServiceUnavailable.ToString());
            }

            var banks = _paymentQueries.GetBanksByBrand(player.BrandId);

            if (banks == null)
            {
                throw new RegoException(ErrorMessagesEnum.ServiceUnavailable.ToString());
            }

            return(banks.Select(x => new BankResponse
            {
                Id = x.Id,
                Name = x.BankName
            }));
        }