Tim Corey discusses Entity Framework Core best practices, common pitfalls, and compares its performance and utility with Dapper.
Entity Framework is an amazing set of tooling around data access. With EFCore, that tooling becomes even more powerful. So why is it that I still don't recommend that people use EFCore? In this video, I will walk you through the best practices of Entity Framework and EFCore and point out the pitfalls to avoid. We will discuss where there are problems and what to do to resolve those problems.
Mailing List: signup.iamtimcorey.com/
Source Code: DevForge.com/downloads/?code=EFBestPractices
Courses: DevForge.com/courses
Blog Post: DevForge.com/blog/137806/entity-framework
nvarchar(max) performance: sqlservercentral.com/forums/topic/nvarchar4000-and-performan…
Downloading SSMS: docs.microsoft.com/en-us/sql/ssms/download-sql-server-manage…
C# Mastercourse: DevForge.com/p/c-mastercourse
Thanks to Ralfs HBK for the chapters breakdown:
- Intro
- Project setup: ASP. NET Core project
- Project setup: .NET standard library
- Project setup: Adding data models
- Project setup: EF Core SQL server NuGet
- Project setup: Data Access class
- EF Configuration: Startup.cs
- EF Configuration: Connection string
- Migration scripts and concerns
- Migration script: Down command
- Migration script: Up command
- Multiple migrations
- Model snapshot...
- Model snapshot: Nvarchar explained
- Problem: Nvarchar(max): Indexing
- Problem: Nvarchar(max): performance
- ... Model snapshot: why nvarchar(max) ...
- Problem: EF and data access
- ... Model snapshot
- Created Data Base overview
- Data model optimization...
- Problem: Development vs production
- ... Data model optimization
- Possible data loss with new migration for in production app
- The updated migration script overview
- No data rollback
- Data Base update
- Using the EF: data import from JSON file
- Using the XEventProfiler
- Monitoring and filtering SQL server commands from the EF app
- How the EF inserts data: sp_executesql
- EF query
- EF query: efficiency and possible consequences
- EF query: where clause: SQL vs C#
- Recap: best practices covered in this video
- Why use Entity Framework? Supposed benefits
- Benefits of using Dapper
- Summary and concluding remarks
Why it's here
2 people recommend this
What people say. Recommended for understanding how to use Entity Framework effectively and comparing its trade-offs with Dapper.
E
u/Eza0o07in r/dotnet • Recommends
On “Plan for Entity Framework Core 5.0”
link to this video
Go to 2:12:12. Tim Corey is a huge fan of Dapper, and not so much of EF. However, in this video he does go through how to use EF effectively, and what to watch out for.
At 2:12:12 he does a comparison between EF and Dapper, which might help you out. I do recommend the whole video though.