开发者

Get EntityKey without loading referenced Entity

is it possible to get entity key from EntityReference property without loading it?

I tried:

entity.EntityKey.EntityKe开发者_如何学GoyValues[0].Value

But if referenced entity isn't loaded by EntityReference.Load() method, EntityKey property is null.

Thank's a lot!


In EF 4, use FK associations instead of independent associations if you want this feature.

For EF 1, EntityKey will be null if the query.MergeOption is MergeOption.NoTracking.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜