File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,14 @@ private ICollection<PropertySelector> ToPropertySelectors(IDictionary<ResourceFi
133133 foreach ( EagerLoadAttribute eagerLoad in resourceContext . EagerLoads )
134134 {
135135 var propertySelector = new PropertySelector ( eagerLoad . Property ) ;
136+
137+ // When an entity navigation property is decorated with both EagerLoadAttribute and RelationshipAttribute,
138+ // it may already exist with a sub-layer. So do not overwrite in that case.
139+ if ( ! propertySelectors . ContainsKey ( propertySelector . Property ) )
140+ {
141+ propertySelectors [ propertySelector . Property ] = propertySelector ;
142+ }
143+
136144 propertySelectors [ propertySelector . Property ] = propertySelector ;
137145 }
138146
You can’t perform that action at this time.
0 commit comments