Compartir a través de


ModelBuilder.ApplyConfigurationsFromAssembly Método

Definición

Aplica la configuración de todas las IEntityTypeConfiguration<TEntity> instancias definidas en el ensamblado proporcionado.

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

Parámetros

assembly
Assembly

Ensamblado que se va a examinar.

predicate
Func<Type,Boolean>

Predicado opcional para filtrar tipos dentro del ensamblado.

Devoluciones

La misma ModelBuilder instancia para que se puedan encadenar llamadas de configuración adicionales.

Atributos

Comentarios

Consulte Modelado de tipos de entidad y relaciones para obtener más información y ejemplos.

Se aplica a