I'm using version 2.1 right now and am running into an issue. I have two tables: Users and Items. The Users table has a primary key of UserID, along with another column called UserName. The Items table has a foreign key relation to the Users table using the UserName column instead of the UserID column.
Inside the SubSonic-generated User class, I see the following code for accessing the Items collection:
public ItemCollection Items()
{
return new ItemCollection().Where(Item.Columns.UserName, UserID).Load();
}
This generates an "Object must implement IConvertible" error, which makes sense because it's trying to compare the UserID (which is an int column) to the UserName (which is a string column). Is my database set up incorrectly or is there a way to configure SubSonic to recognize that the foreign key isn't using the parent's primary key?