ef core add-migration separate assembly for data and domainmodel

.net-core entity-framework-core onion-architecture visual-studio-2017

Question

I have three projects in (VS2017 and ef core) and want to run Add-migration.

  • Web - Startup
  • Core - DomainModel - here are the entitys
  • Data - Context and migrations here. And dependes on ef core

The domainmodel have the entities and I want to have the migrationfiles/ output folder in a data project together with my context file.

I want to avoid having dependecies between domainmodel and entity framework. EntityFrameworkscore only have dependecies to Data. Any suggestions how to run add-migration with this setup to get the migrationfiles in data instead of core/domainmodel?

Add-Migration -Name InitMigration -OutputDir Migrations -Context myDBContext -Project Business\Core

1
2
4/7/2017 7:12:49 AM

Accepted Answer

According to @joakimja the solution was to run:

Add-Migration command without the -Context myDBContext -Project Business\Core arguments.

0
4/10/2017 12:58:56 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow