-
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 runtime annotation support to model. #23929
Conversation
c417f52
to
9c1117f
Compare
41/128 |
9c1117f
to
ac990c0
Compare
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.
See some comments below, LGTM but will let @smitpatel finish his review.
Quick question for my understanding... Does the fact that the relational model is now a runtime annotation mean that it will not be part of the compiled model, i.e. would be recalculated every time on program startup?
src/EFCore.Relational/Infrastructure/RelationalModelExtensions.cs
Outdated
Show resolved
Hide resolved
src/EFCore.Relational/Infrastructure/RelationalModelRuntimeInitializer.cs
Outdated
Show resolved
Hide resolved
Not necessarily, A runtime annotation cannot be set while the model is building, but the compiled model can recreate it during initialization and I plan to include extension points for providers to affect the compiled model. |
23fcdcf
to
f7869a7
Compare
@smitpatel Do you still want to finish reviewing this? |
@AndriySvyryd - Sorry for delay. Moving house was more work than I estimated. (developer issues!). Go ahead with the merging this. |
I still need a software-friendly approval to be able to merge |
Done. I thought Shay already did. These machines are making us do things now-a-days. |
Runtime annotations can only be added to a read-only model and ModelRuntimeInitializer is the service that adds the required ones. Model validation has been moved to ModelRuntimeInitializer. Fixes #22031
f7869a7
to
b8a9d2e
Compare
Hello @AndriySvyryd! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Apologies, while this PR appears ready to be merged, I've been configured to only merge when all checks have explicitly passed. The following integrations have not reported any progress on their checks and are blocking auto-merge:
These integrations are possibly never going to report a check, and unblocking auto-merge likely requires a human being to update my configuration to exempt these integrations from requiring a passing check. Give feedback on thisFrom the bot dev teamWe've tried to tune the bot such that it posts a comment like this only when auto-merge is blocked for exceptional, non-intuitive reasons. When the bot's auto-merge capability is properly configured, auto-merge should operate as you would intuitively expect and you should not see any spurious comments. Please reach out to us at [email protected] to provide feedback if you believe you're seeing this comment appear spuriously. Please note that we usually are unable to update your bot configuration on your team's behalf, but we're happy to help you identify your bot admin. |
@@ -75,7 +78,10 @@ public Model() | |||
/// </summary> | |||
public Model([NotNull] ConventionSet conventions, [CanBeNull] ModelDependencies? modelDependencies = null) | |||
{ | |||
ModelDependencies = modelDependencies; | |||
if (modelDependencies != null) |
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.
Should also rename parameter name?
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.
It mirrors the type name and there's no ambiguity here. Or is there?
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.
The property name is ScopedModelDependencies
. There is so much of inconsistency.
I am fine leaving this as is. With introduction of SingletonModelDependencies, sole ModelDependencies
feels somewhat ambiguous to me but may not be worth a breaking change. API review should capture this too.
Runtime annotations can only be added to a read-only model and
IModelRuntimeInitializer
is the service that adds the required ones.Model validation has been moved to
ModelRuntimeInitializer
.Fixes #22031