Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
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,041 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,564 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,651 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans