开发者

dynamic linq query

I have query to perform whe开发者_开发问答re the user will enter at runtime one of the columns to be included in the result set. And, I won't know until runtime how many columns he could choose from (he uploads a file that can contain a varying number of columns). I'd like to write the query where the index of the column is dynamic. What's the best way to do this kind of query?

Thanks.


You're looking for Dynamic LINQ.

Alternatively, you could generate expression trees from the column names and call ThenBy in a loop.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜