Sdílet prostřednictvím


IEntityTypeConfiguration<TEntity> Rozhraní

Definice

Umožňuje konfiguraci pro typ entity zahrnout do samostatné třídy, nikoli do řádku v OnModelCreating(ModelBuilder). Implementujte toto rozhraní, použijte konfiguraci pro entitu v Configure(EntityTypeBuilder<TEntity>) metodě a pak tuto konfiguraci použijte na model pomocí v ApplyConfiguration<TEntity>(IEntityTypeConfiguration<TEntity>)OnModelCreating(ModelBuilder).

public interface IEntityTypeConfiguration<TEntity> where TEntity : class
type IEntityTypeConfiguration<'Entity (requires 'Entity : null)> = interface
Public Interface IEntityTypeConfiguration(Of TEntity)

Parametry typu

TEntity

Typ entity, který se má konfigurovat.

Poznámky

Další informace a příklady najdete v tématu Modelování typů entit a relací v EF Core .

Metody

Configure(EntityTypeBuilder<TEntity>)

Nakonfiguruje entitu typu TEntity.

Platí pro