Since version 3 Entity Framework Core has supported Interceptors. The interception API allows developers to easily intercept and examine and … Continue reading Using Entity Framework Core Interceptors to log SQL queries
Category: Entity Framework Blog
Below there’s 70+ Entity Framework blog posts on a large variety of Entity Framework topics including:
- new features coming in upcoming versions of EF.
- performance optimisation topics such as using split queries, and how to select only specific columns.
- architecture topics like should we use the repository pattern over Entity Framework and how can we have private constructors and setters when using DB first.
- how-tos, troubleshooting, useful links, miscellaneous etc.
Run Scaffold DBContext without overwriting custom code in Entity Framework core.
I prefer to use DB first approach with Entity framework as many do. In this scenario when the underlying DB … Continue reading Run Scaffold DBContext without overwriting custom code in Entity Framework core.
Generating sequential GUIDs which sort correctly in SQL Server in .net
Using a non sequential GUID in either a clustered or non clustered index is not ideal from a performance point … Continue reading Generating sequential GUIDs which sort correctly in SQL Server in .net
Viewing SQL generated by Entity Framework when querying or calling SaveChanges()
When using Entity Framework, in an effort to track down bugs or performance problems, it’s very handy to see what … Continue reading Viewing SQL generated by Entity Framework when querying or calling SaveChanges()
Validation failed for one or more entities. See ‘EntityValidationErrors’ property for more details
You may see this exception when doing a DbContext.SaveChanges() call. You then may go drilling into the exception details to … Continue reading Validation failed for one or more entities. See ‘EntityValidationErrors’ property for more details
Passing userId to SQL Server delete trigger from entity framework
If you’re in an enterprise environment some form of auditing is likely to be required so you can track who … Continue reading Passing userId to SQL Server delete trigger from entity framework
Improving performance of read only selects in entity framework by turning off tracking with AsNoTracking method
We had a new contractor start the other day in work and he brought to my attention the ability to … Continue reading Improving performance of read only selects in entity framework by turning off tracking with AsNoTracking method
Using Optimistic concurrency with Entity Framework over SQL Server
If you want to have a client-wins or last in wins approach to concurrency management you don’t have to do anything, … Continue reading Using Optimistic concurrency with Entity Framework over SQL Server