-
Notifications
You must be signed in to change notification settings - Fork 158
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
Can't select complex property #1287
Comments
Hello @soshman I am having a hard time reproducing this, could you share the following information:
|
Hi @habbes Here's the repo: sample repo |
@soshman thanks for sharing the repo. Managed to reproduce the issue. I'll investigate this and try to determine the root cause and get back. |
Hi @habbes! Have you got updates on the matter? Thanks! |
Same error here trying to select Address which is of complex type System.InvalidOperationException: Comparing complex types to null is not supported. |
@habbes any progress or plan for that? |
Strange thing here is when using select. The complexproperty is not included in the ef core query. But when using expand it is included but then get the same exception and message. ef core doesn't yet support optional complexproperties. Which is something on their roadmap. But it seems it isn't going to make it in version 9. So it might not be something which needs to be solved here. Although I don't understand why the null check has to be there in the first place. |
While experimenting with OData I've encountered a bug with selecting complex properties.
Setup
I have a Transaction entity that contains Id and Price.
Money is defined as:
The transaction entity is configured this way using EF Fluent API:
My OData configuration is like this:
I don't use Restier or any other libraries. I set up my controller like this:
Data model
Scenario
Calling
/Transactions
and/Transactions(355)
works fine.Calling
/Transactions?$select=id,price
and/Transactions(355)?$select=id,price
throwsSystem.InvalidOperationException
withComparing complex types to null is not supported.
message.Call stack
Assemblies
Microsoft.AspNetCore.OData 8.2.5/9.0.0-preview.2/9.0.0-rc.1
Microsoft.EntityFrameworkCore 8.0.6
Additional context
The only relevant thing I was able to find was a bug reported under the GraphQL GitHub page:
ChilliCream/graphql-platform#6604
This may be a similar scenario. EF Core 8 was used in both of these solutions.
Thanks in advance for the help.
The text was updated successfully, but these errors were encountered: