DEV Community

Discussion on: Building .Net Core API for easy database switch

Collapse
 
jesperreiche profile image
Jesper Reiche

I would not say that it is impossible, but I can say why I think it might be questionable. EF Core uses this exact file (at least, as I wrote in the post, in the version I originally started with) to initialize and handle the migrations. Hence it needs to be present in the project where I want the "Migrations" folder to be placed. So in order to keep from mixing Migration folders and files, between database providers, I have a hard time seeing how it could be done more generic. But I would of course love to be proven wrong - then I would be that much wiser.

Collapse
 
nickstavrou profile image
NickStavrou

I have read this article and while this isn't as generic as i thought it is, it does go to the right direction i believe.
codingblast.com/entityframework-co...

My thought as this being more generic means that if this method can have differerent kind of databases been triggered on runtime.
I am working on on this and if i find a solution i will post it