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.
1 parent a93ea81 commit 487538bCopy full SHA for 487538b
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