-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Model validation for primitive collections #31680
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
Conversation
src/EFCore.Relational/Query/RelationalQueryableMethodTranslatingExpressionVisitor.cs
Show resolved
Hide resolved
|
@roji Well, that was fun. Turs out there was a significant bug where the element type from the type mapping never made it to the |
01c31a1 to
d158b09
Compare
| /// See <see href="https://aka.ms/efcore-docs-conventions">Model building conventions</see> for more information and examples. | ||
| /// </para> | ||
| /// </remarks> | ||
| public class ElementMappingConvention : IModelFinalizingConvention |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge this into type mapping convention
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AndriySvyryd What do you mean by "type mapping convention?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, looks like we've removed it already. This can also be calculated in Property, but this can be done post-8.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think this needs to get revisited after 8. Related #31417.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #31702.
| VerifyError( | ||
| CoreStrings.IdentifyingRelationshipCycle("A -> B"), | ||
| modelBuilder); | ||
| VerifyError(CoreStrings.RelationshipCycle("B", "AId", "ValueConverter"), modelBuilder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did the exception change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because type mapping now attempts to determine keys before getting to the validation, and this detects the same cycle and throws.
d158b09 to
77cdfd2
Compare
Fixes #31617