Subsonic foreign key returning collection?
Posted
by Shaul
on Stack Overflow
See other posts from Stack Overflow
or by Shaul
Published on 2010-06-01T14:41:09Z
Indexed on
2010/06/01
14:43 UTC
Read the original article
Hit count: 247
I'm just writing my first "Hello World" program using Subsonic, for which I've thrown together a simple little Customer/Invoice/InvoiceItem/Product database.
The connection was successfully made to the DB, and it generated all the right ActiveRecord classes. But for some reason, the Invoice class has a property called Customers, which returns a collection of Customer objects, even though the Invoice table has a CustomerID field which has a foreign key to the Customer table. I would have expected a Customer property returning a single Customer object.
I must be doing something wrong - but what?
© Stack Overflow or respective owner