Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save westdavidr/d3e97cc3cf8160eb92c02b4a53e29765 to your computer and use it in GitHub Desktop.
Save westdavidr/d3e97cc3cf8160eb92c02b4a53e29765 to your computer and use it in GitHub Desktop.

Insert customer asynchronously

public async Task<Customer> InsertCustomer(Customer customer)
{
  var cmd = Sequelocity.GetDatabaseCommand();
  cmd.GenerateInsertForSqlServer(customer, "dbo.Customer");
  
  var newId = await cmd.ExecuteScalarAsync<long>();
  return await GetCustomerById(newId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment