Hello,
I am confused between IOrganizationService and IOrganizationServiceContext? When to use out of these two? What are the advantages and disadvantages of one over another?
Please help me to learn this concept or share some links.
Thanks
Hello,
I am confused between IOrganizationService and IOrganizationServiceContext? When to use out of these two? What are the advantages and disadvantages of one over another?
Please help me to learn this concept or share some links.
Thanks
Hi,
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.
OrganizationServiceContext uses an IOrganizationService as the underlying connection. You must have an IOrganizationService instance to use OrganizationServiceContext.
If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.
Best Regards,
Frank Gong
Hi,
This depends how you write your code, using late bound or early bound normally. If you want to write code using late bound you will use IOrganizatoinService but if you want to use early bound option you need to generate classes using CrmSvcUtil and you can use IOrganizationServiceContext.
Refer for more details
docs.microsoft.com/.../iorganizationservice-interface
docs.microsoft.com/.../microsoft.xrm.sdk.client.organizationservicecontext
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,564 Super User 2024 Season 2
Martin Dráb 228,651 Most Valuable Professional
nmaenpaa 101,148