Exemple #1
0
        public async Task <CustomerInfo> GetCustomerInfo(string contractId)
        {
            if (string.IsNullOrEmpty(Query))
            {
                throw new InvalidOperationException("Query is not set");
            }
            if (string.IsNullOrEmpty(contractId))
            {
                throw new ArgumentNullException();
            }
            using (var connection = new OracleConnection())
            {
                connection.ConnectionString = GetConnectionString();
                await connection.OpenAsync();

                var customer = await GetCustomer(connection, new CommandDefinition(GetQuery(contractId)));

                //fill in input info
                if (customer == null)
                {
                    return(null);                  //Cant find customer
                }
                //Return customer with stripped vietnamese accents
                return(StringCleaner.StripAccentsNSpecialChars(customer));
            }
        }