blog main page

PlayingWithExpressions – Part 4: NumericTypesExpressionCreator

In this blog post, we delve into the functionalities of the NumericTypesExpressionCreator class, a powerful tool designed for crafting expressions tailored to numeric comparisons in dynamic scenarios. The CreateExpressions method of the class is dissected step by step, shedding light on its structure, methods, and the underlying logic that empowers developers to effectively handle numeric filtering scenarios.

Read more →

PlayingWithExpressions – Part 3: StringTypesExpressionCreator

In this blog post, we analyze the StringTypesExpressionCreator class, a valuable tool for generating string comparison expressions for specific target string properties. The CreateExpressions method is examined step by step, including the extraction of string member expressions, property access chain construction, type conversion, dynamic method invocation, and the creation of lambda expressions.

Read more →

PlayingWithExpressions – Part 2: Studying Queryable and Enumerable Search Methods

In the world of data manipulation and filtering, the Queryable and Enumerable search extension classes offer developers powerful tools to streamline the process of searching through collections. These extension methods, designed to work with IQueryable and IEnumerable interfaces, leverage a common set of expression creators to dynamically generate filtering expressions based on various data types. In this and later blog post, we will explore the intricacies of both extensions, shedding light on their functionalities and discussing the key differences between them.

Read more →

PlayingWithExpressions – Part 1: Introduction and Reviewing Basic Topics

In this six-part series, we want to experiment with expression trees and create two Enumerable and Queryable extensions helping us search through a collection of objects using a string keyword and list of properties in which we want to search. In the initial part of this article, we establish a foundational understanding of Delegates, Lambdas, and Expression Trees in C#. Delegates serve as references to methods, enabling dynamic method invocation. We exemplify their usage through a simple addition operation. Furthermore, we explore generic delegate types Func and Action, showcasing their application in function representation without custom type declarations. Lastly, we introduce the concepts of normal expressions and expression trees, emphasizing their differences and demonstrating how expression trees enable dynamic code manipulation. In the subsequent four posts, we delve into each component in detail, and the final post showcases practical experimentation with the code. Stay tuned for an in-depth exploration of C# coding concepts.

Read more →