将字符串转换为Linq.Expressions或使用字符串作为Selector? [英] Convert a string to Linq.Expressions or use a string as Selector?

查看:227
本文介绍了将字符串转换为Linq.Expressions或使用字符串作为Selector?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我现在有一个字符串,它的表达式值被评估。它有一个值 expr => expr.FieldName ...所以我想使用这个字符串作为Linq。表达式或任何其他方式查询...像 Select(str)
请帮助我。

解决方案

虽然我没有亲自使用它,但Dynamic Linq Library可能对您。查看ScottGu的帖子: http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx


Well I have a string now that has the expression value to be evaluated..it has say value expr => expr.FieldName ... so I want to use this string as Linq. Expression or any other way to query...like Select(str).
Please help me out.

解决方案

While I haven't personally used it, the Dynamic Linq Library might be useful for you. Check out ScottGu's post: http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx

这篇关于将字符串转换为Linq.Expressions或使用字符串作为Selector?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆