> You can use different level of namespaces; e.g. BookStore, Acme.BookStore or Acme.Retail.BookStore.
### The Solution Structure
`new` command creates a **layered MVC application** with **Entity Framework Core** as the database provider. However, it has additional options. See the [CLI documentation](CLI.md) for all available options.
Extract the zip file downloaded and open in **Visual Studio 2017 (15.9.0+)**:
EF Core database migrations are separated to a project named `.EntityFrameworkCore.DbMigrations`.
The solution has a layered structure (based on [Domain Driven Design](Domain-Driven-Design.md)) and contains unit & integration test projects properly configured to work with **EF Core**&**SQLite in-memory** database.
The solution also contains unit & integration test projects properly configured to work with **EF Core**&**SQLite in-memory** database.
> See [MVC application template document](Startup-Templates/Mvc.md) to understand the solution structure in details.
### Creating the Database
### Database Connection String
Check the **connection string** in the `appsettings.json` file under the `.Web` project:
@ -46,9 +51,29 @@ Check the **connection string** in the `appsettings.json` file under the `.Web`
}
````
The solution is configured to use **Entity Framework Core** with **MS SQL Server**. EF Core supports [various](https://docs.microsoft.com/en-us/ef/core/providers/) database providers, so you can use another DBMS if you want.
The solution is configured to use **Entity Framework Core** with **MS SQL Server**. EF Core supports [various](https://docs.microsoft.com/en-us/ef/core/providers/) database providers, so you can use another DBMS if you want. Change the connection string if you need.
### Create Database & Apply Database Migrations
You have two options to create the database.
Right click to the `.Web` project and select **Set as StartUp Project**:
#### Using the DbMigrator Application
The solution contains a console application (named `Acme.BookStore.DbMigrator` in this sample) that can create database, apply migrations and seed initial data. It is useful on development as well as on production environment.
> `.DbMigrator` project has its own `appsettings.json`. So, if you have changed the connection string above, you should also change this one.
Right click to the `.DbMigrator` project and select **Set as StartUp Project**:
Ef Core has `Update-Database` command which creates database if necessary and applies pending migrations. Right click to the `.Web` project and select **Set as StartUp Project**:
Click the **Login** button, enter `admin` as the username and `1q2w3E*` as the password to login to the application.
The startup template includes the **identity management**module. Once you login, the Identity management menu will be available where you can manage **roles**, **users** and their **permissions**.
The startup template includes the **identity management**and **tenant management** modules. Once you login, the Administration menu will be available where you can manage **tenants**, **roles**, **users** and their **permissions**. User management page is shown below: