tags:

views:

107

answers:

2

Customer customer = new Cliente(4);

In the code an object customer is created locating through IdCliente = 4

How would to create an object customer that possesses a primary key composed, to idEmpresa and idCliente?

+1  A: 

I think you're asking if you can load an subsonic object that has a composite key.

Customer customer = new SubSonic.Select()
  .From(Customer.Schema)
  .Where(Customer.IdEmpresaColumn).IsEqualTo(idEmpresa)
  .And(Customer.IdClienteColumn).IsEqualTo(idCliente)
  .ExecuteSingle();

Please read http://subsonicproject.com/querying/select-queries/.

ranomore
A: 

I would like to pass the values of the key when creating the object. But not had as doing, I will use Select

Thank you

Leandro