2018-03-21 17:04:55 +03:00
|
|
|
# Multiple DbContext Demo
|
|
|
|
|
2018-03-21 17:07:27 +03:00
|
|
|
A sample project to show multiple Entity Framework Core DbContexts working together.
|
2018-03-21 17:04:55 +03:00
|
|
|
|
|
|
|
## How To Run
|
|
|
|
|
|
|
|
* Open project in Visual Studio 2017+.
|
2018-03-21 17:07:27 +03:00
|
|
|
* Select MultipleDbContextEfCoreDemo.Web as start project.
|
2018-03-21 17:04:55 +03:00
|
|
|
|
|
|
|
### Run Migrations
|
|
|
|
|
2018-03-21 17:07:27 +03:00
|
|
|
* Open Package Manager Console, select MultipleDbContextEfCoreDemo.EntityFrameworkCore as default project.
|
2024-08-06 14:21:33 +03:00
|
|
|
* Run command to create first db migration file: **add-migration Added_Person_Entity -Context MultipleDbContextEfCoreDemoDbContext**
|
|
|
|
* Run command to create second db migration file: **add-migration Added_Course_Entity -Contex MultipleDbContextEfCoreDemoSecondDbContext**
|
|
|
|
* Run the ***.Migrator project** to apply the changes to the database.
|
2018-03-21 17:04:55 +03:00
|
|
|
|
|
|
|
### Run Application
|
|
|
|
|
|
|
|
* Run application with F5.
|
|
|
|
* You can see peole and course list.
|
|
|
|
* You can create a new person here.
|