Using C# Expression Trees in the Real World
summary
Shows how C# expression trees are inspected, built with the Expression API, and transformed with an ExpressionVisitor to translate LINQ to SQL for Entity Framework, power AutoMapper’s ProjectTo, and generate runtime lambdas for things like dynamic order‑by and a rules engine. Describes replacing hundreds of stored procedures with expression-based maps, producing predictable SQL, saving “thousands of hours” of work, and compiling expressions for performance comparable to handwritten code. ExpressionVisitor, ProjectTo, dotnetfiddle examples
AI-written summary · about
chapters (10)
- 0:00Introduction to expression trees
- 2:28Lambdas vs. expressions
- 5:01Creating and reading expressions
- 11:53Real-world uses: Entity Framework
- 15:31The power of expression visitors
- 21:32Practical code demonstrations
- 23:36Auto mapper and projection
- 27:21Case study: Building custom integration
- 34:08Advanced dynamic queries
- 41:21Reflection vs. expressions
related talks
49mHow Entity Framework translates LINQ all the way to SQL
01h 00mGetting the best out of Entity Framework Core
01h 02mUnlocking the Full Potential: The Harmonious Dance of EF Core and SQL Server
57mProgramming the SQL Way with Common Table Expressions
01h 01m10 things you didn't know EF Core can do
56mEntity Framework debugging using SQL Server: A Detective Story
37mBeyond Relational with Entity Framework
59m10 things you didn't know EF Core can do
