Primary key

Customer customer = new Cliente(4);    

      

The code creates an object client via IdCliente = 4

How do I create an object client that contains a primary key with idEmpresa and idCliente?

0


a source to share


1 answer


I think you are asking if you can load a subsonic object with 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/ .

+1


a source







All Articles