KEMBAR78
Allow applications to create model building conventions (aka public conventions) · Issue #214 · dotnet/efcore · GitHub
Skip to content

Allow applications to create model building conventions (aka public conventions) #214

@rowanmiller

Description

@rowanmiller
  • Create public interfaces for metadata API to be used by conventions.
  • Change QueryFilter, DefiningQuery, IsEagerLoaded, IsShadowProperty , IsIndexedProperty, BeforeSaveBehavior AfterSaveBehavior to extension methods.
  • Throw when calling SetField would change the shadowness of a property or the name of the identifying MemberInfo.
  • Rename GetContainingPrimaryKey to FindContainingPrimaryKey.
  • Throw when calling SetField on a shadow or a field-only property.
  • Create public interfaces that the internal model builders implement, e.g. IConventionModelBuilder. This will allow cleaner API, without the explicit ConfigurationSource parameter.
  • Throw instead of silently failing when a non-explicit configuration call is invalid. This would require adding quiz API ('CanSet').
  • Make model element references consistent (e.g. Property vs IProperty vs string vs PropertyInfo)
  • Add provider-specific extension methods for convention metadata interfaces.
  • Rename and move RelationalAnnotations and RelationalAnnotationsBuilder to Core.
  • Remove unused methods on provider classes like SqlServerPropertyBuilderAnnotations.ColumnName.
  • Rename the Apply methods to be more descriptive and make the return types consistent, still allowing to stop the execution of the following conventions.
  • Pass CoreConventionSetBuilderDependencies to the constructor of all conventions.
  • Add convention type for configuring a type as owned and use it to remove ambiguous ownerships.
  • Track the model elements as they are modified by conventions, so a call to a convention never returns an element that is no longer in the model.
  • Add a way to delay the convention execution.
  • Move logic from ModelCustomizer to a convention.
  • Add SqlServerValueGenerationStrategy.None value that can be used to override the model default.
  • Filter out the core annotations changes from conventions.
  • Remove PropertyMetadataChanged() calls and don't cache indexes while the model is mutable.
  • Expose conventions as List on ConventionSet
  • Add methods to add/remove a convention to/from all appropriate convention lists.
  • Add a Conventions property of ConventionSetBuilder type to ModelConfigurationBuilder with methods to add/remove a convention

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions