1

is there an easy way to convert a string to a linq query?

e.g. var query = StringToLINQQuery(AString);

has somebody the implementation for this method?

mnemonic
  • 1,585
  • 1
  • 16
  • 25

2 Answers2

1

You would have to compile the string.

The compiler as a service feature is scheduled for C# 5, so it's not here yet. It's already available on Mono, but Mono's support for LINQ was quite shaky last time I checked.

Community
  • 1
  • 1
Frédéric Hamidi
  • 240,249
  • 39
  • 455
  • 462
0

Have you tried already linq dynamics:

http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx

Christian
  • 2,019
  • 1
  • 18
  • 40