web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Error on System.Linq.IQueryable - Join clause

(0) ShareShare
ReportReport
Posted on by 1,328

Hi, I am getting the below errorr for the following code. I know it's an issue with the syntax but I can't figure out how to fix. I am learning c# and plugin development so any help would be appreciated.

            {
                CrmServiceContext crmService = new CrmServiceContext(((IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory))).CreateOrganizationService(new Guid?(val2.UserId)));
                var list = (from x in crmService.SalesOrderDetailSet.Join(
                    crmService.ProductSet, 
                    (SalesOrderDetail x) => x.ProductId.Id, 
                    (Product x) => x.Id, 
                    (SalesOrderDetail x, Product y) => new
                {
                    x,
                    y
                })
                    where x.x.SalesOrderId.Id == salesOrderReference.Id && x.y.ktl_ConsolidateintoServices.Value == true
                    select x).ToList();
                SalesOrder salesOrder = crmService.SalesOrderSet.First((SalesOrder x) => x.Id == salesOrderReference.Id);


Error 1: 'System.Linq.IQueryable<entity>' does not contain a definition for 'Join' and no extension method 'Join' accepting a first argument of type 'System.Linq.IQueryable<entity>' could be found (are you missing a using directive or an assembly reference?) 

Error 2: 'System.Linq.IQueryable<entity>' does not contain a definition for 'First' and no extension method 'First' accepting a first argument of type 'System.Linq.IQueryable<entity>' could be found (are you missing a using directive or an assembly reference?)

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi ,

    Could you please add reference-  System.Data.Entity;

  • epark06 Profile Picture
    1,328 on at

    [quote user="Goutam Das"]

    Hi ,

    Could you please add reference-  System.Data.Entity;

    [/quote]

    Just tried that and still getting the same errors.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans