Пример #1
0
        public async Task <BankResponse> AddBankAsync(AddBank bank)
        {
            BankEntity bankEntity = JsonConvert.DeserializeObject <BankEntity>(JsonConvert.SerializeObject(bank));

            var resp = await _bankRepo.AddBankAsync(bankEntity);

            if (resp == 1)
            {
                return new BankResponse {
                           RequestID = bank.RequestID, StatusCode = "00", Message = "Successfully Added"
                }
            }
            ;
            else
            {
                throw new BadRequestException(new GeneralResponse {
                    code = "400", message = "Failed To Add Bank"
                });
            }
        }