- 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).
- HornetQ Messaging Developer’s Guide
- Learning Cython Programming
- Python機(jī)器學(xué)習(xí):數(shù)據(jù)分析與評分卡建模(微課版)
- Offer來了:Java面試核心知識點(diǎn)精講(原理篇)
- Instant Typeahead.js
- 云原生Spring實戰(zhàn)
- Ray分布式機(jī)器學(xué)習(xí):利用Ray進(jìn)行大模型的數(shù)據(jù)處理、訓(xùn)練、推理和部署
- Java面向?qū)ο蟪绦蜷_發(fā)及實戰(zhàn)
- Blender 3D Incredible Machines
- Scala編程實戰(zhàn)(原書第2版)
- C和C++游戲趣味編程
- Instant PHP Web Scraping
- 自學(xué)Python:編程基礎(chǔ)、科學(xué)計算及數(shù)據(jù)分析(第2版)
- Python 快速入門(第3版)
- ASP.NET Core and Angular 2