2017-08-29 07:54:12 +08:00
|
|
|
<a name="cs"></a>
|
|
|
|
### Add a database connection string
|
|
|
|
|
|
|
|
Add a connection string to the *appsettings.json* file.
|
|
|
|
|
2018-02-25 00:08:11 +08:00
|
|
|
[!code-json[](../../tutorials/razor-pages/razor-pages-start/sample/RazorPagesMovie/appsettings_SQLite.json?highlight=8-10)]
|
2017-08-29 07:54:12 +08:00
|
|
|
|
|
|
|
<a name="reg"></a>
|
|
|
|
### Register the database context
|
|
|
|
|
|
|
|
Register the database context with the [dependency injection](xref:fundamentals/dependency-injection) container in the *Startup.cs* file.
|