Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

IOrganizationService vs IOragnziaService Context

Posted on by 247

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

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: IOrganizationService vs IOragnziaService Context

    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

  • Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: IOrganizationService vs IOragnziaService Context

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans