Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Entity Framework 7 Multiple Context Migration

$
0
0

Project A  (ASP.Net 5 Web)

Project B: Data Access Layer

Project C  (Any Other Layer)

Now if we have multiple context and want to perform migration then solution is:

CMD ->  Cd ProjectB -> 

dnx ef migrations add ["Name Of Migration like DB1Migration"] -c ProjectB.Models.MyContext1

dnx ef migrations add ["Name Of Migration like DB2Migration"] -c ProjectB.Models.MyContext2

dnx ef migrations add ["Name Of Migration like Db3Migration"] -c ProjectB.Models.MyContext3

After that update databse

dnx ef database update -c ProjectB.Models.MyContext1

dnx ef database update -c ProjectB.Models.MyContext2

dnx ef database update -c ProjectB.Models.MyContext3


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>