-
1 votesanswersviews
动态Linq选择转换为IEnumerable
我正在创建一个Widget构建器,它动态地接收查询并返回带有结果的数据表 . 注意:这使用Dynamic Linq接受字符串查询,可以找到库源here 我唯一的问题是将结果集转换为IEnumerable . public DataTable GetEntityData<D>(string Query, int NumbOfResults, List<string> Colu... -
0 votesanswersviews
Disitinct Dynamic Linq
要获得不同的值,我需要一个IEnumerable . var results = gridData.Select(r => r.ExplicitColumnName).Distinct(); 要在运行时确定列名,我需要使用System.Linq.Dynamic所需的IQueryable . var results = gridData.AsQueryable().Select(column... -
1 votesanswersviews
Lambda表达式和扩展方法
所以我有一个像这样定义的扩展方法 public static String FormatString(this String source, String formatString, Object[] parameters) { return String.Format(formatString, parameters); } 从调查中,我已经了解到,当调用... -
2 votesanswersviews
如何从C#中的字符串创建基于动态lambda的Linq表达式?
我在从字符串创建基于Lambda的Linq表达式时遇到一些困难 . 以下是使用此示例对象/类的基本情况: public class MockClass { public string CreateBy { get; set; } } 基本上我需要转换这样的字符串: string stringToConvert = “x => x.CreateBy.Equals(filter.Val... -
3 votesanswersviews
C#Dynamic LINQ:在词典索引器上选择Sum
我'm using dynamic LINQ to create a groupby and select on the fly. My items are key/value collections (dictionaries) so they contain no properties (it'是一个设计要求,不能改变) . 我能够在another question中解决groupby部分,但...