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,605
  • 2
  • 17
  • 26

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
  • 258,201
  • 41
  • 486
  • 479
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
  • 3,503
  • 1
  • 26
  • 47