- 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).
- Vue 3移動Web開發與性能調優實戰
- Oracle WebLogic Server 12c:First Look
- Mastering Objectoriented Python
- Developing Middleware in Java EE 8
- Django開發從入門到實踐
- Data Analysis with Stata
- C語言程序設計案例精粹
- 利用Python進行數據分析(原書第3版)
- Python深度學習原理、算法與案例
- 微信小程序開發實戰:設計·運營·變現(圖解案例版)
- 深度學習入門:基于Python的理論與實現
- 人人都能開發RPA機器人:UiPath從入門到實戰
- 例說FPGA:可直接用于工程項目的第一手經驗
- 關系數據庫與SQL Server 2012(第3版)
- Java Web 從入門到項目實踐(超值版)