Ahmad Ahmadi
Ahmad Ahmadi

Reputation: 49

String Linq to IQueryable

How can I do this :

string queryString = @"from c in Stuffs select c";
IQueryable<Stuffs> q = StringToIQueryable(queryString);

Upvotes: 0

Views: 2601

Answers (1)

saintedlama
saintedlama

Reputation: 6898

See dynamic linq library from Scott Gu that describes how to compose predicates of a linq query from strings. I'm not sure if it's possible to pass a whole linq query but with some custom parsing you should achieve what you want!

Upvotes: 1

Related Questions