I want to fulfill the equivalent of “dynamic SQL” search for a product with variable search criteria, but in C # code. For example, a product is defined as follows:
class Product { public decimal Price { get; set; } public int Quantity { get; set; } }
My search control has a text box for the price and a text box for the quantity. If the user indicates something, he should be included in the search (otherwise not). In fact, my product has many more than two properties.
How can I construct a lambda expression as a whole based on any such search using variable criteria?
Thanks!
source share