-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Microsoft.EntityFrameworkCore.Cosmos "/id" does not match after upgrade to EF 9 #35130
Comments
I'm having this problem. In version 8.x.x, the document structure included both {
"Id": "3cf7d6e8-2821-47e0-85e2-08dc6f5438a6",
"id": "3cf7d6e8-2821-47e0-85e2-08dc6f5438a6",
"...": "other properties"
} However, starting with version 9.0.0, the {
"id": "3cf7d6e8-2821-47e0-85e2-08dc6f5438a6",
"...": "other properties"
} This change specifically affects properties named
|
Found the change in this issue: #34179 Adding
|
I got another error after add System.InvalidOperationException: Unable to materialize entity instance of type 'Gateway'. No discriminators matched the discriminator value ''. |
I also had I'm on thin ice here, but maybe look into the new method of |
Yes, this change was indeed made intentionally in 9.0: standard Cosmos modeling simply has a single lowercase To summarize, new projects should simply use the default behavior and have their .NET @skordesign your error regarding the discriminator value is likely related to another change we made in 9.0, where the discriminator has been renamed from |
Information
The issue happens after upgrade Microsoft.EntityFrameworkCore.Cosmos to 9.0.0. When downgrade to 8.0.10 the issue doesn't happen.
DbContextConfig
Error
When call EnsureCreatedAsync it throws this exception
Include provider and version information
EF Core version: 9.0.0
Database provider: Microsoft.EntityFrameworkCore.Cosmos
Target framework: NET 9.0
Operating system: Windows, Linux
IDE: VScode
The text was updated successfully, but these errors were encountered: