When i have a relation between two entities in my model:
[GroupMember] (*) —– (1) [User]
and tries to select items from this relation with LINQ:
From entity in _user.GroupMember select entity
I always get an empty result unless I load the relation first with following statement:
_user.GroupMember.Load()
Is there a way to avoid loading the relations like this?
If you have cascading relations, you can handle them with
.Include('GroupMember.AnotherTable.YetAnotherTable')which is a little nicer than having to do chained Include calls.