ModelBuilder.ApplyConfigurationsFromAssembly(Assembly, Func<Type,Boolean>) Method

Definition

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

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);
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

Parameters

assembly
Assembly

The assembly to scan.

predicate
Func<Type,Boolean>

Optional predicate to filter types within the assembly.

Returns

ModelBuilder

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

Remarks

See Modeling entity types and relationships for more information.

Applies to