Entity Framework core seed without asp.net app

asp.net asp.net-core-mvc c# entity-framework-core

Question

I currently starting a project that it can growth a lot. To create a good application that I can easily maintain, I'm trying to implement a complex architecture to separate Business/Logic/View...

So my model are in a different project ( .net core library ).

My problem is, that I did not found how to create a Seed to add some data in my database tables without using Startup.cs...

Somebody already implement seed method when database is update ?

1
2
1/1/2017 9:02:17 PM

Accepted Answer

Seeding is done when you Update your database using migrations. So the questions you have to answer are.

  • Are you using Code First Migrations?
  • How are you intending to run them?

When you work out how you intend to run migrations, that will be the same method you use to "seed".

0
12/28/2016 7:22:33 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