IModelSource.GetModel Method

Definition

Overloads

GetModel(DbContext, IConventionSetBuilder)
Obsolete.

Gets the model to be used.

GetModel(DbContext, IConventionSetBuilder, ModelDependencies)

Gets the model to be used.

GetModel(DbContext, IConventionSetBuilder, IModelValidator)

Gets the model to be used.

GetModel(DbContext, IConventionSetBuilder, IModelValidator)

Gets the model to be used.

GetModel(DbContext, IConventionSetBuilder)

Caution

Use the overload with ModelDependencies

Gets the model to be used.

public Microsoft.EntityFrameworkCore.Metadata.IModel GetModel (Microsoft.EntityFrameworkCore.DbContext context, Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder conventionSetBuilder);
[System.Obsolete("Use the overload with ModelDependencies")]
public Microsoft.EntityFrameworkCore.Metadata.IModel GetModel (Microsoft.EntityFrameworkCore.DbContext context, Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder conventionSetBuilder);
abstract member GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder -> Microsoft.EntityFrameworkCore.Metadata.IModel
[<System.Obsolete("Use the overload with ModelDependencies")>]
abstract member GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder -> Microsoft.EntityFrameworkCore.Metadata.IModel
Public Function GetModel (context As DbContext, conventionSetBuilder As IConventionSetBuilder) As IModel

Parameters

context
DbContext

The context the model is being produced for.

conventionSetBuilder
IConventionSetBuilder

The convention set to use when creating the model.

Returns

IModel

The model to be used.

Attributes

Applies to

GetModel(DbContext, IConventionSetBuilder, ModelDependencies)

Gets the model to be used.

public Microsoft.EntityFrameworkCore.Metadata.IModel GetModel (Microsoft.EntityFrameworkCore.DbContext context, Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder conventionSetBuilder, Microsoft.EntityFrameworkCore.Infrastructure.ModelDependencies modelDependencies);
abstract member GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder * Microsoft.EntityFrameworkCore.Infrastructure.ModelDependencies -> Microsoft.EntityFrameworkCore.Metadata.IModel
Public Function GetModel (context As DbContext, conventionSetBuilder As IConventionSetBuilder, modelDependencies As ModelDependencies) As IModel

Parameters

context
DbContext

The context the model is being produced for.

conventionSetBuilder
IConventionSetBuilder

The convention set to use when creating the model.

modelDependencies
ModelDependencies

The dependencies object for the model.

Returns

IModel

The model to be used.

Applies to

GetModel(DbContext, IConventionSetBuilder, IModelValidator)

Gets the model to be used.

public Microsoft.EntityFrameworkCore.Metadata.IModel GetModel (Microsoft.EntityFrameworkCore.DbContext context, Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.IConventionSetBuilder conventionSetBuilder, Microsoft.EntityFrameworkCore.Infrastructure.IModelValidator validator);
abstract member GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.IConventionSetBuilder * Microsoft.EntityFrameworkCore.Infrastructure.IModelValidator -> Microsoft.EntityFrameworkCore.Metadata.IModel
Public Function GetModel (context As DbContext, conventionSetBuilder As IConventionSetBuilder, validator As IModelValidator) As IModel

Parameters

context
DbContext

The context the model is being produced for.

conventionSetBuilder
Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.IConventionSetBuilder

The convention set to use when creating the model.

validator
IModelValidator

The validator to verify the model can be successfully used with the context.

Returns

IModel

The model to be used.

Applies to

GetModel(DbContext, IConventionSetBuilder, IModelValidator)

Gets the model to be used.

public Microsoft.EntityFrameworkCore.Metadata.IModel GetModel (Microsoft.EntityFrameworkCore.DbContext context, Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.IConventionSetBuilder conventionSetBuilder, Microsoft.EntityFrameworkCore.Internal.IModelValidator validator);
abstract member GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.IConventionSetBuilder * Microsoft.EntityFrameworkCore.Internal.IModelValidator -> Microsoft.EntityFrameworkCore.Metadata.IModel
Public Function GetModel (context As DbContext, conventionSetBuilder As IConventionSetBuilder, validator As IModelValidator) As IModel

Parameters

context
DbContext

The context the model is being produced for.

conventionSetBuilder
Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.IConventionSetBuilder

The convention set to use when creating the model.

validator
Microsoft.EntityFrameworkCore.Internal.IModelValidator

The validator to verify the model can be successfully used with the context.

Returns

IModel

The model to be used.

Applies to