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

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans