Problem sets and exercises
After reading about expressions and statements, lambda expressions, and expression trees, Steve wrote an email to Julia, asking for the best way to get more hands-on experience. Julia congratulated Steve and sent him the list with five points that from her understanding every person trying to learn this topic should do:
- Implement a Filter method that takes an
IEnumerable<T>
and a predicate in the form of an expression tree and returns the filtered results. Use it to filter a list of strings based on their length. - Refactor a class with traditional methods into a version using expression-bodied members where appropriate. Compare the two versions.
- Write an application that takes a mathematical expression as a string at runtime, converts it into an expression tree, and evaluates it. The application should support operations such as addition, subtraction, multiplication, and division.
- Design a mini query language for querying in-memory...