Using $compute with ODataQueryOptions<T> not supported? #920
Replies: 1 comment
-
Let's track this in the issue you filed here. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
$compute does not seem to work when using
ODataQueryOptions<T>
. A simple example calculating the length of a string and selecting it.We are using EF Core, if I just pass $compute and $select, it fails with an error like:
`Microsoft.OData.ODataException: Could not find a property named '{{propertyName}}' on type '{{entityType}}'.
If I also pass a $filter, I can see the SQL being generated but then fails with:
System.InvalidOperationException: Sequence contains no matching element at System.Linq.ThrowHelper.ThrowNoMatchException() at Microsoft.AspNetCore.OData.Query.Container.JsonPropertyNameMapper.MapProperty(String propertyName) at Microsoft.AspNetCore.OData.Query.Container.NamedProperty
1.ToDictionaryCore(Dictionary2 dictionary, IPropertyMapper propertyMapper, Boolean includeAutoSelected) at Microsoft.AspNetCore.OData.Query.Wrapper.SelectExpandWrapper.ToDictionary(Func
3 mapperProvider)at Microsoft.AspNetCore.OData.Query.Wrapper.SelectSomeConverter
1.Write(Utf8JsonWriter writer, SelectSome
1 value, JsonSerializerOptions options)`Example project here - https://github.com/blueghostuk/odata-compute-issue
Is there anything I am doing wrong? Or is this not supported?
Beta Was this translation helpful? Give feedback.
All reactions