-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The given model does not contain the type 'System.Object' when using $select with untyped properties #1250
Comments
I can also repro. The issue only happens when the Looks like this was an oversight from the original article @xuzhg . Is this a bug, or is there something missing in the sample to allow for the property to be selected? |
@jusbuc2k @julealgon Thanks for reporting this. Query option on untyped value is not supported yet. When I design/implement, I do have the following: We should support to enable query option on untyped property, same as dynamic property
~/odata/people/1/data?$filter=city eq ‘abc’
Since it’s a more complex scenario, let’s scope this out.
Untyped for operation parameter and return type is scoped out also. |
If we could even make it pluggable in some way, like an interface we can put in DI to implement the important bits, like a Filter/Select/Order binder, so we could implement it in some way that would be specific to a project that might be enough for me. |
Assemblies affected
Microsoft.AspNetCore.OData 8.25 and previous versions
Describe the bug
An exception is thrown when using $select on an untyped property after following this guide to setup untyped properties:
https://devblogs.microsoft.com/odata/enable-un-typed-within-asp-net-core-odata/#:~:text=In%20ASP.NET%20Core%20OData%2C%20it%E2%80%99s%20easy%20to%20build,a%20single%20value%20untyped%20property%2C%20for%20example%20Data.
Reproduce steps
[EnableQuery]
to line 18 on the HandlePeopleController/odata/people?$select=Id,Name,Data
Data Model
See the example repo at https://github.com/xuzhg/MyAspNetCore/tree/master/src/UntypedApp
EDM (CSDL) Model
See the example repo at https://github.com/xuzhg/MyAspNetCore/tree/master/src/UntypedApp
Request/Response
Expected behavior
I expect to get the Id, Name, and Data properties with their values just as if I had omitted the $select parmeter.
Screenshots
Working
Not Working
Additional context
The text was updated successfully, but these errors were encountered: