Using C# Expression Trees in the Real World
summary
Shows how C# expression trees power Entity Framework, AutoMapper and custom tooling by building and compiling Expression.Parameter/MethodCall trees, using ExpressionVisitor to translate to T‑SQL, and generating dynamic lambdas for fast delegates. Describes a SQL generator that replaces hundreds of stored procedures, supports joins and common transforms, and saves thousands of developer hours over 2–3 years. Covers AutoMapper project to to avoid SELECT *, dynamic order‑by/property selectors, JSON rules → expressions, and pitfalls like missing null‑prop and explicit casts.
AI-written summary · about
chapters (25)
- 0:00Introduction
- 2:32lambda expressions
- 8:20expression API
- 13:08Real world talk
- 13:34Entity Framework
- 15:38Queryable
- 17:08Expression Visitor
- 17:45Expression Parts
- 18:07Expression Visitors
- 23:28AutoMapper
- 24:37AutoMapper Example
- 25:47AutoMapper Magic
- 26:37Spencers Background
- 27:24Model Mapping
- 28:35Stored Procedures
- 30:44Syntax Generators
- 32:11Translating Expressions
- 33:31The Result
- 35:02A Closer Look
- 36:14Cooking an Expression
- 39:32Dotnet Fiddle
- 40:50Rules Engine
- 43:22Example
- 44:57Expressions vs Reflection
- 46:27Expressions are not perfect








