private void AddCustomer(InMemoryDB db, int customerId) { var customer = new SampleCustomerInformation() { Age = 10, CustomerId = customerId, Name = "Mohsen" }; db.AddCustomer(customer); }
public void AddCustomer(SampleCustomerInformation customer) { using (SqlConnection sqlConn = new SqlConnection(_connection)) { sqlConn.Open(); SqlCommand sqlCmd = new SqlCommand("AddCustomer", sqlConn); sqlCmd.CommandType = System.Data.CommandType.StoredProcedure; sqlCmd.Parameters.AddWithValue("@customerId", customer.CustomerId); sqlCmd.Parameters.AddWithValue("@title", customer.Title); sqlCmd.Parameters.AddWithValue("@birthdate", customer.Birthdate.Date); sqlCmd.Parameters.AddWithValue("@address", customer.Address); sqlCmd.Parameters.AddWithValue("@job", customer.Job); sqlCmd.ExecuteNonQuery(); } }
internal void AddCustomer(SampleCustomerInformation customer) { var shard = GetShard(customer.CustomerId.ToString()); shard.AddCustomer(customer); }
public void AddCustomer(SampleCustomerInformation customer) { customers.Add(customer); }