views:

129

answers:

1

Hi! 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.

+3  A: 

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

devio
thanks a lot!!!
Alexander