That's been done for you: CustomerEntity has an identity column: customerID
CustomerEntity newCustomer = new CustomerEntity();
newCustomer.CompanyName = "Solutions Design";
//... rest of fields filled in here
adapter.SaveEntity(newCustomer);
int customerID = newCustomer.CustomerID;