- Mastering Entity Framework Core 2.0
- Prabhakaran Anbazhagan
- 159字
- 2021-07-02 21:16:41
The appsettings.json setting
The application settings, as we explored earlier, are based on JSON, and in order to include a setting, we need to add a JSON key-value pair. In our case, ConnectionStrings is the key and the value is again a JSON object that defines DefaultConnection:
{
"ConnectionStrings": {
"DefaultConnection": "Server=
(localdb)\\mssqllocaldb;Database=MasteringEFCoreDbFirst;
Trusted_Connection=True;MultipleActiveResultSets=true"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
}
}
In this section, we have configured the database context in the ConfigureServices() method and also leveraged appsettings.json to make the connection configurable. At this point, all the configuration necessary is completed and EF is ready to consume the database for further implementation. Let's see how the CRUD operations could be performed using EF (we have already seen them in Chapter 1, Kickstart - Introduction to Entity Framework Core, but still, we will explore a few parts with respect to rendering that which were not covered earlier).
- Java多線程編程實戰指南:設計模式篇(第2版)
- Getting Started with ResearchKit
- Instant Apache Stanbol
- CentOS 7 Server Deployment Cookbook
- Mastering SVG
- 編寫高質量代碼:改善Python程序的91個建議
- 趣學Python算法100例
- 網絡爬蟲原理與實踐:基于C#語言
- Getting Started with Laravel 4
- Android應用案例開發大全(第二版)
- Python開發基礎
- WebStorm Essentials
- Spring Boot從入門到實戰
- 安卓工程師教你玩轉Android
- IBM RUP參考與認證指南