-
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
GetProperty should return null if not found; instead it throws an exception #27791
Comments
Just wanted to share a workaround I've used in the past which is to use FindProperty instead. Not sure what the semantic difference between Get and Find is but the latter method allows null. |
|
I think the exception case not must be workarounded, its safe to know that the problem exist that have a an error in the program logic and dont know why. Just my opinion |
Use client value comparer as provider value comparer if possible The client value comparer will not be used if the model type is a nullable value type since we need the types to match exactly and the provider type is never nullable Fix some API issues Remove some unused code Fixes #27738 Fixes #27850 Fixes #27791 Part of #27588
We have a disconnect between what the documents say should be happening versus what's implemented.
In the file IReadOnlyEntityType.cs when you try to get a property that does not exist it throws an InvalidOperationException whereas the expected return value is null.
Example
Include stack traces
Include provider and version information
EF Core version: 6.0.3
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 6
Operating system: Windows 10
IDE: VS 2022
The text was updated successfully, but these errors were encountered: