Skip to content
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

Fix API consistency errors in metadata #20267

Merged
merged 1 commit into from
Mar 17, 2020
Merged

Conversation

AndriySvyryd
Copy link
Member

@AndriySvyryd AndriySvyryd commented Mar 12, 2020

Add more Metadatada API consistency tests
Refactor ApiConsistencyTest

Consistency errors fixed:

  • All mutating methods should have a bool fromDataAnnotation = false parameter on IConvention*
  • All mutable facets should have a corresponding Get*ConfigurationSource() method on IConvention*
  • All mutable facets should have a corresponding CanSet*() method on IConvention*Builder
  • Fluent API can only be prefixed by "Has", "HasNo", "To", "Is". Metadata API can only be prefixed by "Add", "Remove", "Get", "Is"
  • Provider-specific extensions should have matching IModel and IMutable* methods
  • Set* methods on IMutable* types should return void and on IConvention* should return the configured value
  • Remove* methods on IMutable* and IConvention* type should return the removed value

Fixes #17360
Fixes #20269

@ajcvickers
Copy link
Member

@AndriySvyryd So...how breaking is applying these rules now?

@AndriySvyryd
Copy link
Member Author

@ajcvickers Since there's still no public API for adding conventions the impact on the vast majority of users should be minimal. We'll discuss each actual change in the API review.

Add more Metadatada API consistency tests
Refactor ApiConsistencyTest

Fixes #17360
@AndriySvyryd AndriySvyryd merged commit 858dfe7 into master Mar 17, 2020
@AndriySvyryd AndriySvyryd deleted the Issue17360ConventionAPI branch March 17, 2020 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OnModelCreating instead of OnConfiguring Make sure that the metadata API is consistent
2 participants