This chapter covers
- Seeing how your application’s DbContext detects changes in tracked entities
- Using the change tracking method in your DbContext to build an audit trail
- Using raw SQL commands via the DbContext’s Database property
- Finding the entities to database mapping using DbContext’s Model property
- Using EF Core’s database connection resiliency
This chapter looks at the properties and methods available in the application’s DbContext. You’ve seen a few of these properties and methods before, such as the Add, Update, and Remove methods covered in chapter 3, but in this chapter, you’ll dig deeper into how they work. You’ll also look at some other properties and methods that haven’t been covered in earlier chapters. You will look at each method used to write to the database, ways to make saving data quicker, and ways to execute SQL commands directly on your database. You’ll also look at accessing and using your EF Core configuration information.