ModelBuilder.ApplyConfiguration 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
ApplyConfiguration<TEntity>(IEntityTypeConfiguration<TEntity>)
套用實例中 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>)
警告
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 實例,以便鏈結其他組態呼叫。
- 屬性