阅读背景:

将Linq中的外键设置为SQL

来源:互联网 

It's well known that you cannot set foreign key IDs directly in Linq to SQL if the entities have already been loaded. You can however look up the entity by it's foreign key and then set the entity as the foreign entity using the entity relationship. (I've taken out the enum here and used integer values for simplicity). i.e. If I have a loaded Appointment entity and an associated AppoinmentStatus Entity I can't do this:-It's well known that you cannot set foreign key




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: