Asp – Set foreign key value in business entity data model

asp.netlinq

I have table SublocationTbl that have SubLocationName and LocationId(this field is foreign key from table LocationTbl), and I have business entity data model
I know that the foreign key dosen't appear in the business entity
my problrm is: how can I set the value of locationId when I need to add new subLocation?

Best Answer

IF you want to see the foreign key it self you must use .NET framework 4 not less in .NET 3.5 you'll find a reference to foreign key's class not the foreign key it self

Store s = new Store(); User u=s.User;//bring referance of the user with foreign key .net 3.5 & 4 int i = s.User_ID;//bring the user_id forein key .net 4