Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ModelBuilder.ApplyConfigurationsFromAssembly Method

Definition

Namespace:
Microsoft.EntityFrameworkCore
Assembly:
Microsoft.EntityFrameworkCore.dll
Package:
Microsoft.EntityFrameworkCore v10.0.0
Package:
Microsoft.EntityFrameworkCore v2.2.6
Package:
Microsoft.EntityFrameworkCore v3.0.0
Package:
Microsoft.EntityFrameworkCore v3.1.0
Package:
Microsoft.EntityFrameworkCore v5.0.0
Package:
Microsoft.EntityFrameworkCore v6.0.0
Package:
Microsoft.EntityFrameworkCore v7.0.0
Package:
Microsoft.EntityFrameworkCore v8.0.0
Package:
Microsoft.EntityFrameworkCore v9.0.0
Source:
ModelBuilder.cs
Source:
ModelBuilder.cs
Source:
ModelBuilder.cs
Source:
ModelBuilder.cs
Source:
ModelBuilder.cs
Source:
ModelBuilder.cs
Source:
ModelBuilder.cs
Source:
ModelBuilder.cs
Source:
ModelBuilder.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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

[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);
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.")>]
abstract member ApplyConfigurationsFromAssembly : System.Reflection.Assembly * Func<Type, bool> -> Microsoft.EntityFrameworkCore.ModelBuilder
override this.ApplyConfigurationsFromAssembly : System.Reflection.Assembly * Func<Type, bool> -> Microsoft.EntityFrameworkCore.ModelBuilder
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

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


Feedback

Was this page helpful?