CRM 2011 OrganizationServiceProxy vs OrganizationServiceContext

后端 未结 2 1561
不思量自难忘°
不思量自难忘° 2021-02-13 05:55

I am reading through the MS CRM 2011 SDK docs and see two ways for accessing entities: OrganizationServiceContext or OrganizationServiceProxy.

Why would I choose one m

2条回答
  •  你的背包
    2021-02-13 06:19

    OrganizationServiceContext contains the LINQ provider for CRM. Using it you can construct LINQ queries instead of using QueryExpression or FetchExpressions which are required if you use IOrganizationService direclty.

    crmsvcutil.exe can generate a CRM organization specific class that inherits from OrganizationServiceContext in that case you get properties like ContactSet, AccountSet on the generated class that make it easier to compose queries.

    You must have an IOrganizationService isntance to use OrganizationServiceContext.

    See http://msdn.microsoft.com/en-us/library/gg328028.aspx for more details.

提交回复
热议问题