ModelBuilder.ApplyConfigurationsFromAssembly Method

Definition

Applies configuration from all IEntityTypeConfiguration<TEntity> instances that are defined in provided assembly.

C#
public virtual Microsoft.EntityFrameworkCore.ModelBuilder ApplyConfigurationsFromAssembly (System.Reflection.Assembly assembly, Func<Type,bool> predicate = default);
C#
public virtual Microsoft.EntityFrameworkCore.ModelBuilder ApplyConfigurationsFromAssembly (System.Reflection.Assembly assembly, Func<Type,bool>? predicate = default);
C#
[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);

Parameters

assembly
Assembly

The assembly to scan.

predicate
Func<Type,Boolean>

Optional predicate to filter types within the assembly.

Returns

The same ModelBuilder instance so that additional configuration calls can be chained.

Attributes

Remarks

See Modeling entity types and relationships for more information and examples.

Applies to

Proizvod Verzije
Entity Framework Core 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0