Yes, it is possible to utilize EF Core migrations even if the EF code is distributed among various solutions. The migrations can be created and applied separately for each solution that contains EF code.
To create migrations in a solution, you need to use the EF Core tools. You can either install the tools globally on your machine or install them locally in each solution. Once the tools are installed, you can run the dotnet ef migrations add <migration-name>
command to create a new migration.
When you need to apply the migrations to a database, you can run the dotnet ef database update
command in each solution. If the solutions share the same database, the migrations will be applied sequentially.
Note that you need to make sure that the EF code in each solution targets the same database schema version to ensure that the migrations work correctly across solutions.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-03-24 11:00:00 +0000
Seen: 8 times
Last updated: Oct 24 '21
How can Gitlab CI be utilized for ASP.NET Core 7 by utilizing Docker Images on an on-premise server?
How can I send an array of objects to a controller in ASP.NET 6 (Core)?
Are there any available clients for ASP.NET Core websockets in Unity?
What is the process to turn off the event logging feature in ASP.NET core microservices?
How can I view the Resources window in Microsoft Blend 2019 for a .Net Core WPF project?