【问题标题】:What Changes Does Referencing CodeGeneration.CodeCustomization Make to the Early Bound Generated CRM Entities?引用 CodeGeneration.CodeCustomization 对早期绑定生成的 CRM 实体有何更改?
【发布时间】:2023-04-07 18:43:01
【问题描述】:

阅读this SO question后,我注意到link in the question引用了Microsoft.Xrm.Client.CodeGeneration.CodeCustomization,Microsoft.Xrm.Client.CodeGeneration

与标准代码生成相比,它有什么优势?根据 LameCoder,它将所有实体更改为继承自 Microsoft.Xrm.Client.CrmEntity 而不是 `Microsoft.Xrm.Sdk.Entity。这会产生哪些变化以及产生了哪些其他变化?

【问题讨论】:

    标签: dynamics-crm-2011 dynamics-crm-online dynamics-crm-2013


    【解决方案1】:

    这是best site I could currently find 的作用:

    • CrmSvcUtil 和 OrganizationServiceContext 增强功能,例如延迟加载
    • 使用连接对话框 UI 简化连接管理
    • 客户端缓存扩展
    • 用于常见任务的实用程序扩展功能以加快客户端开发速度
    • 组织服务消息实用程序功能可以轻松调用常见消息,例如 BulkDelete、将成员添加到团队等。
    • 支持 Microsoft.Xrm.Portal 扩展的对象

    我认为从 CrmEntity 继承的唯一真正缺点是它需要 Microsoft.Xrm.Client dll 在服务器上进行 Gac 处理,或者将 IL 合并到 Entities dll 中。

    除了一个缺点之外,我看到它添加了以下功能:

    • 将 INotifyPropertyChanging 和 INotifyPropertyChanged 移到基类中,使生成的代码更小
    • 定义附加类属性
      • System.Data.Services.Common.DataServiceKeyAttribute
      • System.Data.Services.IgnorePropertiesAttribute(我假设这个通过网络发送的数据较少?)
      • Microsoft.Xrm.Client.Metadata.EntityAttribute(我相信这是用来支持LazyLoading的
    • 选项集属性更改为可为空的整数
    • 货币属性现在可以为可以为空的小数
    • 将属性值设置为现有值,不会触发属性更改/更改事件
    • SetPrimaryIdAttributeValue 会产生更小的代码。

    【讨论】:

      猜你喜欢
      • 2014-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-18
      • 1970-01-01
      相关资源
      最近更新 更多