Exemplo n.º 1
0
 public void Insert(ICustomer customer)
 {
     using (IDatabaseTransaction workUnit = new DatabaseTransaction( )) {
         customer.ChangeIdTo(_gateway.ExecuteScalar(Queries.Insert( )));
         _registrationMapper.Insert(customer.Registration( ), customer.ID( ));
         _boatMapper.Insert(customer.RegisteredBoats( ), customer.ID( ));
         _leaseMapper.Insert(customer.Leases( ), customer.ID( ));
         workUnit.Commit( );
     }
 }