6 Tips and techniques for reading and writing with EF Core
This chapter covers
- Selecting the right approach to read data from the database
- Writing queries that perform well on the database side
- Avoiding problems when you use Query Filters and special LINQ commands
- Using AutoMapper to write Select queries more quickly
- Writing code to quickly copy and delete entities in the database
The first four chapters covers different ways to read/write to a database and in chapter 5 you used that information to build the Book App - an ASP.NET Core web application. This chapter brings together lots of different tips and techniques for reading and writing data with EF Core.
The chapter is split into two sections: reading from the database and writing to the database. Each section covers certain read/write issues you may come across, but at the same time explains how EF Core achieves this solution. The aim is to give you lots of practical tips by solving different problems and at the same time deepen your knowledge of how EF Core works. The tips are useful but, in the long run, becoming an expert on EF Core is going to make you a better developer.
TIP
Don’t forget that the companion Git repo https://github.com/JonPSmith/EfCoreinAction-SecondEdition contains unit tests for every chapter of the book. For this chapter, look in the Test project in the master branch for classes starting with Ch06_. Sometimes seeing the code is quicker than reading the words.