Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ private ICollection<PropertySelector> ToPropertySelectors(IDictionary<ResourceFi
foreach (EagerLoadAttribute eagerLoad in resourceContext.EagerLoads)
{
var propertySelector = new PropertySelector(eagerLoad.Property);

// When an entity navigation property is decorated with both EagerLoadAttribute and RelationshipAttribute,
// it may already exist with a sub-layer. So do not overwrite in that case.
if (!propertySelectors.ContainsKey(propertySelector.Property))
{
propertySelectors[propertySelector.Property] = propertySelector;
}

propertySelectors[propertySelector.Property] = propertySelector;
}

Expand Down