Beyond LINQ: Using Expression Trees in .NET
summary
Shows how expression trees become a code‑generation toolkit: building a spec builder that creates dynamic filters and sorters for IQueryable, composing predicates with a parameter rebinder so OR/AND work without Invoke, and transpiling C# validation expressions into JavaScript for React/Angular forms. Recommends creating delegates via compile+cache for performance, cites large speedups replacing Activator/Invoke with compiled constructor delegates, and demonstrates working scaffolding and integration‑test generation that reduced boilerplate in production.
AI-written summary · about
chapters (30)
- 0:00Introduction and context
- 1:07E-commerce scenario
- 1:48The problem with ORMs
- 5:32Delegates vs. expressions
- 6:11Advanced de-compilation
- 8:24Combining criteria
- 10:00Specification pattern
- 11:41Implementation details
- 12:27Live coding and debugging
- 14:18Handling expression invoke
- 15:56Rebinding expression parameters
- 16:35Expression composition
- 17:02Practical implementation analysis
- 20:55Advanced composition tricks
- 22:48Meta-programming overview
- 23:40Automapper integration
- 25:08Automatic filtering and sorting
- 25:53Dynamic query demo
- 26:37Code generation for logic
- 28:55Cross-platform validation
- 30:21Transpiling to JavaScript
- 30:46Type definition communication
- 31:24Validation demo
- 31:48Backend-to-Frontend sync
- 33:20Expression visitors
- 34:55Testing with expressions
- 35:12Analyzing invocations
- 35:57Integration test automation
- 37:56Performance benchmarks
- 41:27Conclusion
related talks
51mUsing C# Expression Trees in the Real World
48mExpression trees in C#
44mEFCore - Expression trees climbing
01h 02mThinking in LINQ
59mExpression Templates: Past, Present, Future
08mInterview with Mads Torgersen & Kresten Krab
01h 02mUsing C#'s Type System Effectively
01h 08mThinking Functionally with C#
