Solution structure:
- Domain
- Entities
- Data
-
Context
- MyDbContext.cs
-
Maps
- 20+ configs
-
- MyApp – startup project
Currently I’m applying configs like this:
<code>protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyConfiguration(new MyEntity1());
// etc. 20+ times
}
</code>
<code>protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyConfiguration(new MyEntity1());
// etc. 20+ times
}
</code>
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyConfiguration(new MyEntity1());
// etc. 20+ times
}
I tried using ApplyConfigurationsFromAssembly with typeof(MyDbContext).Assembly
GetType().Assembly
Assembly.GetExecutingAssembly()
arguments, but it didn’t work. When launched, it gives a mapping error as if I had not specified the appropriate files.
New contributor
Stormhead is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.