ModelSource.GetModel Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Sobrecargas
GetModel(DbContext, IConventionSetBuilder) |
Obsoleto.
Obsoleto.
Retorna o modelo do cache ou cria um modelo se ele não estiver presente no cache. |
GetModel(DbContext, IConventionSetBuilder, ModelDependencies) |
Obsoleto.
Retorna o modelo do cache ou cria um modelo se ele não estiver presente no cache. |
GetModel(DbContext, IConventionSetBuilder, IModelValidator) |
Retorna o modelo do cache ou cria um modelo se ele não estiver presente no cache. |
GetModel(DbContext, IConventionSetBuilder, IModelValidator) |
Retorna o modelo do cache ou cria um modelo se ele não estiver presente no cache. |
GetModel(DbContext, ModelCreationDependencies, Boolean) |
Obtém o modelo a ser usado. |
GetModel(DbContext, IConventionSetBuilder)
Cuidado
Use the overload with ModelDependencies
Cuidado
Use the overload with ModelCreationDependencies
Retorna o modelo do cache ou cria um modelo se ele não estiver presente no cache.
public virtual Microsoft.EntityFrameworkCore.Metadata.IModel GetModel (Microsoft.EntityFrameworkCore.DbContext context, Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder conventionSetBuilder);
[System.Obsolete("Use the overload with ModelDependencies")]
public virtual Microsoft.EntityFrameworkCore.Metadata.IModel GetModel (Microsoft.EntityFrameworkCore.DbContext context, Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder conventionSetBuilder);
[System.Obsolete("Use the overload with ModelCreationDependencies")]
public virtual 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
override this.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
override this.GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder -> Microsoft.EntityFrameworkCore.Metadata.IModel
[<System.Obsolete("Use the overload with ModelCreationDependencies")>]
abstract member GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder -> Microsoft.EntityFrameworkCore.Metadata.IModel
override this.GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder -> Microsoft.EntityFrameworkCore.Metadata.IModel
Public Overridable Function GetModel (context As DbContext, conventionSetBuilder As IConventionSetBuilder) As IModel
Parâmetros
- context
- DbContext
O contexto para o qual o modelo está sendo produzido.
- conventionSetBuilder
- IConventionSetBuilder
A convenção definida para usar ao criar o modelo.
Retornos
O modelo a ser usado.
Implementações
- Atributos
Aplica-se a
GetModel(DbContext, IConventionSetBuilder, ModelDependencies)
Cuidado
Use the overload with ModelCreationDependencies
Retorna o modelo do cache ou cria um modelo se ele não estiver presente no cache.
public virtual Microsoft.EntityFrameworkCore.Metadata.IModel GetModel (Microsoft.EntityFrameworkCore.DbContext context, Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder conventionSetBuilder, Microsoft.EntityFrameworkCore.Infrastructure.ModelDependencies modelDependencies);
[System.Obsolete("Use the overload with ModelCreationDependencies")]
public virtual 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
override this.GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder * Microsoft.EntityFrameworkCore.Infrastructure.ModelDependencies -> Microsoft.EntityFrameworkCore.Metadata.IModel
[<System.Obsolete("Use the overload with ModelCreationDependencies")>]
abstract member GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder * Microsoft.EntityFrameworkCore.Infrastructure.ModelDependencies -> Microsoft.EntityFrameworkCore.Metadata.IModel
override this.GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetBuilder * Microsoft.EntityFrameworkCore.Infrastructure.ModelDependencies -> Microsoft.EntityFrameworkCore.Metadata.IModel
Public Overridable Function GetModel (context As DbContext, conventionSetBuilder As IConventionSetBuilder, modelDependencies As ModelDependencies) As IModel
Parâmetros
- context
- DbContext
O contexto para o qual o modelo está sendo produzido.
- conventionSetBuilder
- IConventionSetBuilder
A convenção definida para usar ao criar o modelo.
- modelDependencies
- ModelDependencies
O objeto de dependências do modelo.
Retornos
O modelo a ser usado.
Implementações
- Atributos
Aplica-se a
GetModel(DbContext, IConventionSetBuilder, IModelValidator)
Retorna o modelo do cache ou cria um modelo se ele não estiver presente no cache.
public virtual 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
override this.GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.IConventionSetBuilder * Microsoft.EntityFrameworkCore.Infrastructure.IModelValidator -> Microsoft.EntityFrameworkCore.Metadata.IModel
Public Overridable Function GetModel (context As DbContext, conventionSetBuilder As IConventionSetBuilder, validator As IModelValidator) As IModel
Parâmetros
- context
- DbContext
O contexto para o qual o modelo está sendo produzido.
- conventionSetBuilder
- Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.IConventionSetBuilder
A convenção definida para usar ao criar o modelo.
- validator
- IModelValidator
O validador para verificar se o modelo pode ser usado com êxito com o contexto.
Retornos
O modelo a ser usado.
Implementações
Aplica-se a
GetModel(DbContext, IConventionSetBuilder, IModelValidator)
Retorna o modelo do cache ou cria um modelo se ele não estiver presente no cache.
public virtual 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
override this.GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.IConventionSetBuilder * Microsoft.EntityFrameworkCore.Internal.IModelValidator -> Microsoft.EntityFrameworkCore.Metadata.IModel
Public Overridable Function GetModel (context As DbContext, conventionSetBuilder As IConventionSetBuilder, validator As IModelValidator) As IModel
Parâmetros
- context
- DbContext
O contexto para o qual o modelo está sendo produzido.
- conventionSetBuilder
- Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.IConventionSetBuilder
A convenção definida para usar ao criar o modelo.
- validator
- Microsoft.EntityFrameworkCore.Internal.IModelValidator
O validador para verificar se o modelo pode ser usado com êxito com o contexto.
Retornos
O modelo a ser usado.
Implementações
Aplica-se a
GetModel(DbContext, ModelCreationDependencies, Boolean)
Obtém o modelo a ser usado.
public virtual Microsoft.EntityFrameworkCore.Metadata.IModel GetModel (Microsoft.EntityFrameworkCore.DbContext context, Microsoft.EntityFrameworkCore.ModelCreationDependencies modelCreationDependencies, bool designTime);
abstract member GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.ModelCreationDependencies * bool -> Microsoft.EntityFrameworkCore.Metadata.IModel
override this.GetModel : Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.ModelCreationDependencies * bool -> Microsoft.EntityFrameworkCore.Metadata.IModel
Public Overridable Function GetModel (context As DbContext, modelCreationDependencies As ModelCreationDependencies, designTime As Boolean) As IModel
Parâmetros
- context
- DbContext
O contexto para o qual o modelo está sendo produzido.
- modelCreationDependencies
- ModelCreationDependencies
O objeto de dependências usado durante a criação do modelo.
- designTime
- Boolean
Se o modelo deve conter configuração de tempo de design.
Retornos
O modelo a ser usado.
Implementações
Aplica-se a
Entity Framework