-
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
Add model validation for nested dependents #23229
Comments
Related: #21488 |
I updated model according to above. Test still fails in assert after loading required graph. When we load root, root->RequiredSingle materializes always because there is no differentiating property. root->RequiredSingle->Single is not materialized because the values are null in the bool column inside RequiredSingle2 class. Test seems like making wrong assertion. @AndriySvyryd ? |
Investigating more - The model falls into a kind of invalid model. We need to warn for this and also make the model also act like RequiredSingle is actually required. |
Based on current design, we should add model validation to detect when there is an optional dependent that doesn't have any required properties that are not shared. |
Design meeting N notes:
|
Design meeting N+ M notes:
|
Older snapshots which are already having this kind of faulty model would start throwing exception (tests are failing in source rn). What direction are we taking on it? @dotnet/efteam |
We don't run model validation on snapshots |
Looks like test in model snapshot processor is failing because the runtime model is faulty. I will debug more. |
If there are no non-PK required properties.
See
GraphUpdatesSqlServerTest.Owned.Required_one_to_one_are_cascade_deleted
Model:
Root.RequiredSingle
is an optional dependentAdd
r.Navigation(e => e.Single).IsRequired();
to markRoot.RequiredSingle.Single
as requiredRemove
RequiredSingle1.Bool
The text was updated successfully, but these errors were encountered: