Summary
In this chapter, we learned about three different Entity Framework Core patterns including Repository and Unit of Work, Specification, and Extension Methods and how to implement each one into your own projects.
Then, we examined some of the standards in the industry, such as confirming your model, adding async
/await
to your LINQ calls, implementing logging, using resource files for seeding data, and understanding deferred execution.
We also reviewed how to perform read-only queries and how to leverage the database by letting it perform data-intensive procedures.
Finally, we applied these standards to an existing application with a way to create our database using the model-first approach, then examined how to add an asynchronous, read-only mode using the .AsNoTracking()
method so that state isn’t attached to objects, how to include child entities when retrieving a parent model, and finally, how to extend your model while letting Entity Framework know which properties...