ModelBuilder.ApplyConfigurationsFromAssembly Metoda

Definice

Použije konfiguraci ze všech IEntityTypeConfiguration<TEntity> instancí, které jsou definovány v zadaném sestavení.

public virtual Microsoft.EntityFrameworkCore.ModelBuilder ApplyConfigurationsFromAssembly (System.Reflection.Assembly assembly, Func<Type,bool> predicate = default);
public virtual Microsoft.EntityFrameworkCore.ModelBuilder ApplyConfigurationsFromAssembly (System.Reflection.Assembly assembly, Func<Type,bool>? predicate = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This API isn't safe for trimming, since it searches for types in an arbitrary assembly.")]
public virtual Microsoft.EntityFrameworkCore.ModelBuilder ApplyConfigurationsFromAssembly (System.Reflection.Assembly assembly, Func<Type,bool>? predicate = default);
abstract member ApplyConfigurationsFromAssembly : System.Reflection.Assembly * Func<Type, bool> -> Microsoft.EntityFrameworkCore.ModelBuilder
override this.ApplyConfigurationsFromAssembly : System.Reflection.Assembly * Func<Type, bool> -> Microsoft.EntityFrameworkCore.ModelBuilder
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This API isn't safe for trimming, since it searches for types in an arbitrary assembly.")>]
abstract member ApplyConfigurationsFromAssembly : System.Reflection.Assembly * Func<Type, bool> -> Microsoft.EntityFrameworkCore.ModelBuilder
override this.ApplyConfigurationsFromAssembly : System.Reflection.Assembly * Func<Type, bool> -> Microsoft.EntityFrameworkCore.ModelBuilder
Public Overridable Function ApplyConfigurationsFromAssembly (assembly As Assembly, Optional predicate As Func(Of Type, Boolean) = Nothing) As ModelBuilder

Parametry

assembly
Assembly

Sestavení, které se má zkontrolovat.

predicate
Func<Type,Boolean>

Volitelný predikát pro filtrování typů v rámci sestavení.

Návraty

Stejná ModelBuilder instance, aby bylo možné zřetězeným voláním další konfigurace.

Atributy

Poznámky

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

Platí pro