-
Book Overview & Buying
-
Table Of Contents
Metaprogramming in C#
By :
In this chapter, we learned about a valuable member of the .NET class libraries called expressions. Thanks to the symbiosis of the C# compiler and the runtime, you get another approach to reason about the running code.
Expressions represent a structured approach for representing, well, expressions. There is somewhat of a resemblance to an abstract syntax tree, which all code compilers produce when parsing code. Something we’ll get more familiar with in Chapter 15, Roslyn Compiler Extensions.
As we’ve seen in this chapter, the type of expressions can be for just capturing information, but they can also be more powerful and capture operations that can be executed.
In the next chapter, we will dive deeper into expressions and see how you can build out expressions at runtime that you can then execute dynamically.