-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

ASP.NET 8 Best Practices
By :

Even though Entity Framework patterns provide additional structure to your code, there are also common practices to keep in mind when building applications with Entity Framework.
In this section, we’ll review some of the more common uses of Entity Framework and their benefits: how async
/await
can make your application more scalable, logging your queries to optimize SQL output, creating resource files to hold seed data for tables, learning about deferred execution, speeding up access with a read-only method called .AsNoTracking()
, leveraging the database where it makes sense, and using AutoMapper to map source objects to destination objects.
If you’re using the database-first approach (where you have an existing database to work with) to generate your models, confirm that all of your indexes, relationships, identity fields, and foreign keys represent your model accordingly before using Scaffold-DbContext...