예제 #1
0
        public async Task AddBankCharges(string amount)
        {
            try
            {
                var value = int.Parse(amount);
                var bankChargeOperation = new BankChargeOperationCommand(value);
                await _adminManager.AddBankCharges(bankChargeOperation);
            }
            catch (DbUpdateException ex)
            {
                var updateException = (UpdateException)ex.InnerException;
                var sqlException    = (SqlException)updateException.InnerException;

                foreach (SqlError error in sqlException.Errors)
                {
                    // TODO: Do something with your errors
                }
            }
            catch (Exception ex)
            {
                Logger.Error("Error in AddBankCharge method", ex);
                WebFaultThrower.Throw(ex.Message, HttpStatusCode.InternalServerError);
            }
        }