本文介绍了引用CodeGeneration.CodeCustomization对早期绑定生成的CRM实体有什么改变?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在阅读后,我注意到引用了 Microsoft.Xrm.Client.CodeGeneration.CodeCustomization,Microsoft .Xrm.Client.CodeGeneration

After reading this SO question, I noticed that the link in the question made a reference to Microsoft.Xrm.Client.CodeGeneration.CodeCustomization,Microsoft.Xrm.Client.CodeGeneration.

与标准代码生成相比,它有什么优势?根据LameCoder的说法,它将所有实体更改为继承自 Microsoft.Xrm.Client.CrmEntity ,而不是继承自Microsoft.Xrm.Sdk.Entity。会进行哪些更改以及创建其他哪些更改?

What advantages it has over the standard code gen? According to LameCoder it changes all the entities to inherit from Microsoft.Xrm.Client.CrmEntity rather than `Microsoft.Xrm.Sdk.Entity. What changes does that make and what other changes are created?

推荐答案

这是:

从CrmEntity继承的缺点是,它要求Microsoft.Xrm.Client dll必须在服务器上Gac'd或将IL合并到Entities dll中。

The only real downside I can see to inheriting from CrmEntity is that it requires the Microsoft.Xrm.Client dll to either be Gac'd on the server, or IL Mergered into the Entities dll.

除了缺点之外,还有一些我看到的功能:

Besides that one downside, here are the features I see it adding:


  • 将INotifyPropertyChanging和INotifyPropertyChanged移到基类中,生成结果代码较小

  • 定义其他类属性

    • System.Data.Services.Common.DataServiceKeyAttribute

    • System.Data.Services.IgnorePropertiesAttribute (我假设这是通过网络发送较少的数据?)

    • Microsoft.Xrm.Client.Metadata.EntityAttribute (我相信这是用来支持LazyLoading

    • Moves INotifyPropertyChanging and INotifyPropertyChanged into the base class, making resulting code smaller
    • Defines additional class Attributes
      • System.Data.Services.Common.DataServiceKeyAttribute
      • System.Data.Services.IgnorePropertiesAttribute (I'm assuming this one sends less data over the wire?)
      • Microsoft.Xrm.Client.Metadata.EntityAttribute (I believe this is used to support LazyLoading

      这篇关于引用CodeGeneration.CodeCustomization对早期绑定生成的CRM实体有什么改变?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 09:42