ModelBuilder.ApplyConfiguration 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
ApplyConfiguration<TEntity>(IEntityTypeConfiguration<TEntity>)
- Source:
- ModelBuilder.cs
- Source:
- ModelBuilder.cs
- Source:
- ModelBuilder.cs
- Source:
- ModelBuilder.cs
- Source:
- ModelBuilder.cs
- Source:
- ModelBuilder.cs
- Source:
- ModelBuilder.cs
- Source:
- ModelBuilder.cs
- Source:
- ModelBuilder.cs
应用实例中 IEntityTypeConfiguration<TEntity> 定义的配置。
public virtual Microsoft.EntityFrameworkCore.ModelBuilder ApplyConfiguration<TEntity> (Microsoft.EntityFrameworkCore.IEntityTypeConfiguration<TEntity> configuration) where TEntity : class;
abstract member ApplyConfiguration : Microsoft.EntityFrameworkCore.IEntityTypeConfiguration<'Entity (requires 'Entity : null)> -> Microsoft.EntityFrameworkCore.ModelBuilder (requires 'Entity : null)
override this.ApplyConfiguration : Microsoft.EntityFrameworkCore.IEntityTypeConfiguration<'Entity (requires 'Entity : null)> -> Microsoft.EntityFrameworkCore.ModelBuilder (requires 'Entity : null)
Public Overridable Function ApplyConfiguration(Of TEntity As Class) (configuration As IEntityTypeConfiguration(Of TEntity)) As ModelBuilder
类型参数
- TEntity
要配置的实体类型。
参数
- configuration
- IEntityTypeConfiguration<TEntity>
要应用的配置。
返回
同一 ModelBuilder 实例,以便可以链接其他配置调用。
注解
有关详细信息和示例,请参阅 为实体类型和关系建模 。
适用于
ApplyConfiguration<TQuery>(IQueryTypeConfiguration<TQuery>)
- Source:
- ModelBuilder.cs
- Source:
- ModelBuilder.cs
- Source:
- ModelBuilder.cs
- Source:
- ModelBuilder.cs
注意
Use IEntityTypeConfiguration<TEntity> instead
应用实例中 IQueryTypeConfiguration<TQuery> 定义的配置。
public virtual Microsoft.EntityFrameworkCore.ModelBuilder ApplyConfiguration<TQuery> (Microsoft.EntityFrameworkCore.IQueryTypeConfiguration<TQuery> configuration) where TQuery : class;
[System.Obsolete("Use IEntityTypeConfiguration<TEntity> instead")]
public virtual Microsoft.EntityFrameworkCore.ModelBuilder ApplyConfiguration<TQuery> (Microsoft.EntityFrameworkCore.IQueryTypeConfiguration<TQuery> configuration) where TQuery : class;
abstract member ApplyConfiguration : Microsoft.EntityFrameworkCore.IQueryTypeConfiguration<'Query (requires 'Query : null)> -> Microsoft.EntityFrameworkCore.ModelBuilder (requires 'Query : null)
override this.ApplyConfiguration : Microsoft.EntityFrameworkCore.IQueryTypeConfiguration<'Query (requires 'Query : null)> -> Microsoft.EntityFrameworkCore.ModelBuilder (requires 'Query : null)
[<System.Obsolete("Use IEntityTypeConfiguration<TEntity> instead")>]
abstract member ApplyConfiguration : Microsoft.EntityFrameworkCore.IQueryTypeConfiguration<'Query (requires 'Query : null)> -> Microsoft.EntityFrameworkCore.ModelBuilder (requires 'Query : null)
override this.ApplyConfiguration : Microsoft.EntityFrameworkCore.IQueryTypeConfiguration<'Query (requires 'Query : null)> -> Microsoft.EntityFrameworkCore.ModelBuilder (requires 'Query : null)
Public Overridable Function ApplyConfiguration(Of TQuery As Class) (configuration As IQueryTypeConfiguration(Of TQuery)) As ModelBuilder
类型参数
- TQuery
要配置的查询类型。
参数
- configuration
- IQueryTypeConfiguration<TQuery>
要应用的配置。
返回
同一 ModelBuilder 实例,以便可以链接其他配置调用。
- 属性