11 Going deeper into the DbContext

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 ...

Get Entity Framework Core in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.