| ▲ | adzm 4 days ago |
| The lambda is converted into an Expression, basically a syntax tree, which is then analyzed to see what is accessed. |
|
| ▲ | javier2 3 days ago | parent [-] |
| Ok, so its a step in the compile that rewrites and analyzes it? |
| |
| ▲ | adzm 2 days ago | parent [-] | | It's actually really neat. Normally a lambda would just be a function but if it gets cast to an Expression then you get the AST at runtime. Entity Framework analyzes these at runtime to generate the SQL and logic/mapping etc. You can get the AST at compile time in some situations with a Roslyn plug-in or etc I believe as well. |
|