I want to implement simple LINQ-to-SQL-like functionality in my .net application.
For example i have the following code:
userAccounts.Where(ua=>ua.Name=="User1");
and i want delegate in Where method to create a string like this
"name = 'User1'".
How it can be done?
Thanks.
The solution you are looking for is called Expression Tree Visitor.
See this blog on how to parse and visualize the query’s .Expression property