What Changes Does Referencing CodeGeneration.CodeCustomization Make to the Early Bound Generated CRM Entities?

后端 未结 1 676
北恋
北恋 2021-01-13 12:30

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.

相关标签:
1条回答
  • 2021-01-13 13:12

    Here is the best site I could currently find on what it does:

    • CrmSvcUtil & OrganizationServiceContext enhancements such as lazy loading
    • Simplified Connection Management with Connection Dialog UI
    • Client Side caching extensions
    • Utility Extension functions for common tasks to speed up client development
    • Organization Service Message utility functions to make it easy to call common messages such as BulkDelete, Add Member to Team etc.
    • Objects to support the Microsoft.Xrm.Portal extensions

    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:

    • 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
    • Option Sets properties are changed to nullable ints
    • Money properties are now nullable decimals
    • Setting a property value to the value it already is, will not trigger a property changing/changed event
    • SetPrimaryIdAttributeValue results in smaller code.
    0 讨论(0)
提交回复
热议问题