ModelSource ModelSource Class

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.

Syntax

Declaration

public abstract class ModelSource : IModelSourcePublic MustInherit Class ModelSource
    Implements IModelSource

Inheritance Hierarchy

  • System.Object
    System.Object
  • ModelSource
    ModelSource

Inherited Members

ToString(),
ToString(),
Equals(Object),
Equals(Object),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetHashCode(),
GetHashCode(),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Constructors summary

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 summary

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

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

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

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

Methods summary

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

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

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

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

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.

    protected ModelSource(IDbSetFinder setFinder, ICoreConventionSetBuilder coreConventionSetBuilder, IModelCustomizer modelCustomizer, IModelCacheKeyFactory modelCacheKeyFactory)Protected Sub New(setFinder As IDbSetFinder, coreConventionSetBuilder As ICoreConventionSetBuilder, modelCustomizer As IModelCustomizer, modelCacheKeyFactory As IModelCacheKeyFactory)

    Parameters

Properties

  • CoreConventionSetBuilder
    CoreConventionSetBuilder

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

    protected virtual ICoreConventionSetBuilder CoreConventionSetBuilder { get; }Protected Overridable ReadOnly Property CoreConventionSetBuilder As ICoreConventionSetBuilder

    Property Value

  • ModelCacheKeyFactory
    ModelCacheKeyFactory

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

    protected virtual IModelCacheKeyFactory ModelCacheKeyFactory { get; }Protected Overridable ReadOnly Property ModelCacheKeyFactory As IModelCacheKeyFactory

    Property Value

  • ModelCustomizer
    ModelCustomizer

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

    protected virtual IModelCustomizer ModelCustomizer { get; }Protected Overridable ReadOnly Property ModelCustomizer As IModelCustomizer

    Property Value

  • SetFinder
    SetFinder

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

    protected virtual IDbSetFinder SetFinder { get; }Protected Overridable ReadOnly Property SetFinder As IDbSetFinder

    Property Value

Methods

  • CreateConventionSet(IConventionSetBuilder)
    CreateConventionSet(IConventionSetBuilder)

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

    protected virtual ConventionSet CreateConventionSet(IConventionSetBuilder conventionSetBuilder)Protected Overridable Function CreateConventionSet(conventionSetBuilder As IConventionSetBuilder) As ConventionSet

    Parameters

    Returns

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

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

    protected virtual IModel CreateModel(DbContext context, IConventionSetBuilder conventionSetBuilder, IModelValidator validator)Protected Overridable Function CreateModel(context As DbContext, conventionSetBuilder As IConventionSetBuilder, validator As IModelValidator) As IModel

    Parameters

    Returns

  • FindSets(ModelBuilder, DbContext)
    FindSets(ModelBuilder, DbContext)

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

    protected virtual void FindSets(ModelBuilder modelBuilder, DbContext context)Protected Overridable Sub FindSets(modelBuilder As ModelBuilder, context As DbContext)

    Parameters

  • 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.

    public virtual IModel GetModel(DbContext context, IConventionSetBuilder conventionSetBuilder, IModelValidator validator)Public Overridable Function GetModel(context As DbContext, conventionSetBuilder As IConventionSetBuilder, validator As IModelValidator) As IModel

    Parameters

    Returns

Details

Assembly

Microsoft.EntityFrameworkCore.dll