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
.
精彩评论