【问题标题】:CRM LINQ + Creating Dynamic where clause for anonymous typesCRM LINQ + 为匿名类型创建动态 where 子句
【发布时间】:2011-06-15 20:37:54
【问题描述】:
var crm = new XrmDataContext("Crm");

var properties = from property in crm.awx_propertyawx_properties

orderby property.awx_name

select new {
    awx_name = property.awx_name == null ? "no name" : property.awx_name
      }
                                ;
 properties = properties.Where(a => a.awx_name.StartsWith("Sears Tower"));

我收到错误“无法确定属性名称” - 我在这里做错了什么?我读了很多线程,这是完全可以做的。帮助!

【问题讨论】:

    标签: linq where-clause anonymous-types dynamics-crm-4


    【解决方案1】:

    我也花了很长时间试图找到一种针对 CRM 系统发布动态 where 子句的方法。

    我在上面尝试了类似的语法,还构建了一个谓词构建器。两者都不起作用。

    最后我不得不采取两阶段的方法。 1. 使用静态 where 子句从 CRM 中拉出超集到集合中 2. 使用标准技术从我的内存集合中动态查询。

    我讨厌 CRM。

    菲尔

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-04-30
      • 1970-01-01
      • 2023-04-08
      • 1970-01-01
      • 2023-03-29
      • 1970-01-01
      • 2017-07-14
      相关资源
      最近更新 更多