Browse Source

Add database creation section to Microservice-Demo document.

pull/988/head
Halil ibrahim Kalkan 8 years ago
parent
commit
1755ff75a5
  1. 26
      docs/en/Samples/Microservice-Demo.md
  2. BIN
      docs/en/images/microservice-sample-update-database-authserver.png
  3. BIN
      docs/en/images/microservice-sample-update-database-products.png

26
docs/en/Samples/Microservice-Demo.md

@ -116,11 +116,29 @@ To be able to run the solution from source code, following tools should be insta
* Run `dotnet restore` from the command line inside the `samples\MicroserviceDemo` folder. * Run `dotnet restore` from the command line inside the `samples\MicroserviceDemo` folder.
* Build the solution in Visual Studio. * Build the solution in Visual Studio.
#### Restore Databases #### Create Databases
Open `MsDemo_Identity.zip` and `MsDemo_ProductManagement.zip` inside the `samples\MicroserviceDemo\databases` folder and restore to the SQL Server. MongoDB database is created dynamically, however you need to create database schemas for SQL server databases. The solution is configured to use Entity Core Code First migrations, so you can easily create databases.
> Notice that: These databases have EF Core migrations in the solution, however they don't have seed data, especially required for IdentityServer4 configuration. So, restoring the databases is much more easier. There are two SQL server databases in this solution.
##### MsDemo_Identity Database
* Right click to the `AuthServer.Host` project and click to the `Set as startup project`.
* Open the **Package Manager Console** (Tools -> Nuget Package Manager -> Package Manager Console)
* Select `AuthServer.Host` as the **Default project**.
* Run `Update-Database` command.
![microservice-sample-update-database-authserver](../images/microservice-sample-update-database-authserver.png)
##### MsDemo_ProductManagement
- Right click to the `ProductService.Host` project and click to the `Set as startup project`.
- Open the **Package Manager Console** (Tools -> Nuget Package Manager -> Package Manager Console)
- Select `ProductService.Host` as the **Default project**.
- Run `Update-Database` command.
![microservice-sample-update-database-products](../images/microservice-sample-update-database-products.png)
#### Run Projects #### Run Projects
@ -136,6 +154,8 @@ Run the projects with the following order (right click to each project, set as s
* BackendAdminApp.Host * BackendAdminApp.Host
* PublicWebSite.Host * PublicWebSite.Host
When you run projects, they will add some initial demo data to their databases.
## A Brief Overview of the Solution ## A Brief Overview of the Solution
The Visual Studio solution consists of multiple projects each have different roles in the system: The Visual Studio solution consists of multiple projects each have different roles in the system:

BIN
docs/en/images/microservice-sample-update-database-authserver.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
docs/en/images/microservice-sample-update-database-products.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Loading…
Cancel
Save