-
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
Consider breaking up ModelValidator #15660
Comments
Note from triage. Consider a different factoring such that validation is split up by what needs to be verified. For example, for things that need to validate a property, we should iterate over the properties once and call out to each validator in that loop. |
Thinking about this again in relation to the PR for change tracking proxies. Currently there is no way for a non-provider extension to influence model validation because the single IModelValidator service is already overridden by providers. We could implement something similar to At a high level, it seems that validation should be factored into small discrete blocks. Ideally a provider would then not add additional validation by overriding existing validation. This could be combined with the refactoring mentioned in the note from triage above. Removing from the backlog to discuss with the team both in terms of the overall plan, the scheduling of the change, and what are immediate guidance is for the change tracking PR. |
Note to implementer: Change detecting proxies (PR #19437) should be updated when this issue is fixed. |
…ects Refactor RelationalModelValidator Part of #15660
…ects Refactor RelationalModelValidator Part of #15660
Note to implementer: Also break up |
Currently
ModelValidator
has protected method for each area to validate. These could be instead separate services that can be resolved from D.I. and composed. This could make it easier for non-providers to add custom validation in the same way they can add custom conventions.Note however that order is important--if we make this change, the current order in which validations happen should not be changed.
Update: the main value here is allowing plugins to do model validation. For example, see change-detecting proxies. See comments below.
The text was updated successfully, but these errors were encountered: