We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e34709d + 70abcd5 commit 024f1c7Copy full SHA for 024f1c7
src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/SelectClauseBuilder.cs
@@ -133,6 +133,14 @@ private ICollection<PropertySelector> ToPropertySelectors(IDictionary<ResourceFi
133
foreach (EagerLoadAttribute eagerLoad in resourceContext.EagerLoads)
134
{
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
144
propertySelectors[propertySelector.Property] = propertySelector;
145
}
146
0 commit comments