ModelSource ModelSource Class

Definition

A base implementation of IModelSource that produces a model based on the DbSet<TEntity> properties exposed on the context. The model is cached to avoid recreating it every time it is requested.

This type is typically used by database providers (and other extensions). It is generally not used in application code.

public abstract class ModelSource : IModelSource
Public MustInherit Class ModelSource
    Implements IModelSource
Inheritance
System.ObjectSystem.Object
ModelSourceModelSource
Implements

Constructors

ModelSource(IDbSetFinder, ICoreConventionSetBuilder, IModelCustomizer, IModelCacheKeyFactory) ModelSource(IDbSetFinder, ICoreConventionSetBuilder, IModelCustomizer, IModelCacheKeyFactory)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

Properties

CoreConventionSetBuilder CoreConventionSetBuilder

Gets the ICoreConventionSetBuilder that will build the conventions to be used to build the model.

ModelCacheKeyFactory ModelCacheKeyFactory

Gets the IModelCacheKeyFactory that will create keys used to store and lookup models the model cache.

ModelCustomizer ModelCustomizer

Gets the IModelCustomizer that will perform additional configuration of the model in addition to what is discovered by convention.

SetFinder SetFinder

Gets the IDbSetFinder that will locate the DbSet<TEntity> properties on the derived context.

Methods

CreateConventionSet(IConventionSetBuilder) CreateConventionSet(IConventionSetBuilder)

Creates the convention set to be used for the model. Uses the CoreConventionSetBuilder if conventionSetBuilder is null.

CreateModel(DbContext, IConventionSetBuilder, IModelValidator) CreateModel(DbContext, IConventionSetBuilder, IModelValidator)

Creates the model. This method is called when the model was not found in the cache.

System.Object.Equals(System.Object) System.Object.Equals(System.Object) Inherited from System.Object
System.Object.Equals(System.Object, System.Object) System.Object.Equals(System.Object, System.Object) Inherited from System.Object
FindSets(ModelBuilder, DbContext) FindSets(ModelBuilder, DbContext)

Adds the entity types found in DbSet<TEntity> properties on the context to the model.

System.Object.GetHashCode() System.Object.GetHashCode() Inherited from System.Object
GetModel(DbContext, IConventionSetBuilder, IModelValidator) GetModel(DbContext, IConventionSetBuilder, IModelValidator)

Returns the model from the cache, or creates a model if it is not present in the cache.

System.Object.GetType() System.Object.GetType() Inherited from System.Object
System.Object.MemberwiseClone() System.Object.MemberwiseClone() Inherited from System.Object
System.Object.ReferenceEquals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) Inherited from System.Object
System.Object.ToString() System.Object.ToString() Inherited from System.Object