@ -41,7 +44,7 @@ You can find the completed solution on {{if UI == "MVC"}}[the GitHub repository]
## Creating the Solution
Before starting to the development, create a new solution named `Acme.BookStore` and run it by following the [getting started tutorial](../Getting-Started-{{if UI == 'NG'}}Angular{{else}}AspNetCore-MVC{{end}}-Template#creating-a-new-project).
Before starting to the development, create a new solution named `Acme.BookStore` and run it by following the [getting started tutorial](../Getting-Started.md).
## Create the Book Entity
@ -107,7 +110,7 @@ The final folder/file structure should be as shown below:
### Add Book Entity to the DbContext
{{if DB == "ef"}}
{{if DB == "EF"}}
EF Core requires to relate entities with your `DbContext`. The easiest way to do this is to add a `DbSet` property to the `BookStoreDbContext` class in the `Acme.BookStore.EntityFrameworkCore` project, as shown below:
@ -121,7 +124,7 @@ public class BookStoreDbContext : AbpDbContext<BookStoreDbContext>
{{end}}
{{if DB == "mongodb"}}
{{if DB == "Mongo"}}
Add a `IMongoCollection<Book> Books` property to the `BookStoreMongoDbContext` inside the `Acme.BookStore.MongoDB` project:
@ -135,7 +138,7 @@ public class BookStoreMongoDbContext : AbpMongoDbContext
{{end}}
{{if DB == "ef"}}
{{if DB == "EF"}}
### Map the Book Entity to a Database Table
@ -261,13 +264,13 @@ Run the `Acme.BookStore.DbMigrator` application to update the database:
`.DbMigrator` is a console application that can be run to **migrate the database schema** and **seed the data** on **development** and **production** environments.
{{end}}
{{if DB == "mongodb"}}
{{if DB == "Mongo"}}
While MongoDB **doesn't require** a database schema migration, it is still good to run this application since it **seeds the initial data** on the database. This application can be used on **development** and **production** environments.
@ -52,11 +54,11 @@ Each project is used to test the related project. Test projects use the followin
* [Shoudly](http://shouldly.readthedocs.io/en/latest/) as the assertion library.
* [NSubstitute](http://nsubstitute.github.io/) as the mocking library.
{{if DB="ef"}}
{{if DB="EF"}}
> The test projects are configured to use **SQLite in-memory** as the database. A separate database instance is created and seeded (with the data seed system) to prepare a fresh database for every test.
{{else if DB="mongodb"}}
{{else if DB="Mongo"}}
> **[Mongo2Go](https://github.com/Mongo2Go/Mongo2Go)** library is used to mock the MongoDB database. A separate database instance is created and seeded (with the data seed system) to prepare a fresh database for every test.