You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A query which selects all the properties with the wildcard selector on a collection of entities returned from an unbound function throws an exception:
in Microsoft.OData.Edm.EdmUtil.CheckArgumentNull[T](T value, String parameterName) in Microsoft.OData.Edm\EdmUtil.cs: riga 363
in Microsoft.OData.Edm.ExtensionMethods.<StructuralProperties>d__106.MoveNext() in Microsoft.OData.Edm\ExtensionMethods.cs: riga 1012
in Microsoft.AspNetCore.OData.Query.Validator.SelectExpandQueryValidator.ValidateWildcardSelectItem(WildcardSelectItem wildCardSelectItem, SelectExpandValidatorContext validatorContext) in D:\a\1\s\src\Microsoft.AspNetCore.OData\Query\Validator\SelectExpandQueryValidator.cs: riga 338
in Microsoft.AspNetCore.OData.Query.Validator.SelectExpandQueryValidator.ValidateSelectExpand(SelectExpandClause selectExpandClause, SelectExpandValidatorContext validatorContext) in D:\a\1\s\src\Microsoft.AspNetCore.OData\Query\Validator\SelectExpandQueryValidator.cs: riga 107
in Microsoft.AspNetCore.OData.Query.Validator.SelectExpandQueryValidator.Validate(SelectExpandQueryOption selectExpandQueryOption, ODataValidationSettings validationSettings) in D:\a\1\s\src\Microsoft.AspNetCore.OData\Query\Validator\SelectExpandQueryValidator.cs: riga 54
in Microsoft.AspNetCore.OData.Query.SelectExpandQueryOption.Validate(ODataValidationSettings validationSettings) in D:\a\1\s\src\Microsoft.AspNetCore.OData\Query\Query\SelectExpandQueryOption.cs: riga 266
in Microsoft.AspNetCore.OData.Query.Validator.ODataQueryValidator.Validate(ODataQueryOptions options, ODataValidationSettings validationSettings) in D:\a\1\s\src\Microsoft.AspNetCore.OData\Query\Validator\ODataQueryValidator.cs: riga 106
in Microsoft.AspNetCore.OData.Query.ODataQueryOptions.Validate(ODataValidationSettings validationSettings) in D:\a\1\s\src\Microsoft.AspNetCore.OData\Query\ODataQueryOptions.cs: riga 652
It appears that ODataQueryContext.TargetStructuredType is null despite the returned type being a valid entity collection from an entity set.
The culprit should be here:
Xriuk
changed the title
ODataQueryOptions does not support unbound functions (OperationImportSegment)
ODataQueryContext does not support unbound functions (OperationImportSegment)
Dec 20, 2024
Assemblies affected
ASP.NET Core OData 8.2.4
Describe the bug
A query which selects all the properties with the wildcard selector on a collection of entities returned from an unbound function throws an exception:
It appears that
ODataQueryContext.TargetStructuredType
is null despite the returned type being a valid entity collection from an entity set.The culprit should be here:
AspNetCoreOData/src/Microsoft.AspNetCore.OData/Routing/ODataPathExtensions.cs
Line 199 in d0b2f76
because it appears that
OperationImportSegment
(which should be an unbound function/action) is not handled and is returning null.In fact if I "patch" ODataPath by replacing
OperationImportSegment
withOperationSegment
it works.The text was updated successfully, but these errors were encountered: