简体   繁体   中英

String Linq to IQueryable

How can I do this :

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

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM