C# & CLR Internals (50 Qs)•Part 3: CLR Internals, Native AOT & Production Diagnostics (25 - 35)
Delegates vs Expression Trees.
senior LevelData Structures
In Simple Words:
- Delegates (
Func<T, bool>): Compiled IL code executed directly by the CPU in memory (e.g.IEnumerable.Where()). - Expression Trees (
Expression<Func<T, bool>>): Data structure representing the AST (Abstract Syntax Tree) of the code. Entity Framework parses Expression Trees at runtime and translates the C# logic into raw SQL queries executed by the database engine!