Hi,
I'm working with an database first object model - and I'm facing an issue which I can only assume is something strange with my set-up.
Basically, I'm trying to add a new object to the database - the table for which has some foreign keys like thus:
Rather than getting an instance of the User and the Country from the database, I'm setting just the CreatedByUserId and CountryCode properties (I know what these values are)
Unfortunately, when I set just the value properties - I get an error:
CountryCode has definitely been populated. Also, if I change the code to set just the Country and CreatedByUser properties - all is good...
There's two possible things I can think of:
- OpenAccess is getting confused as the Project class is derived from Group (using flat hierarchy)
- OpenAccess doesn't support simply setting the foreign key value (I'm hoping this isn't the case - as I REALLY don't want to have to re-retrieve the user each time I create an object!)
Any help greatly appreciated