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
133
133
foreach ( EagerLoadAttribute eagerLoad in resourceContext . EagerLoads )
134
134
{
135
135
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
+
136
144
propertySelectors [ propertySelector . Property ] = propertySelector ;
137
145
}
138
146
You can’t perform that action at this time.
0 commit comments