Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 694171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:49:46+00:00 2026-05-14T02:49:46+00:00

I am trying a LINQ to Object query on 2 collections Customer.Orders Branches.Pending.Orders (Collection

  • 0

I am trying a LINQ to Object query on 2 collections

  1. Customer.Orders
  2. Branches.Pending.Orders (Collection within a collection)

I want to output each branch which is yet to deliver any order of the customer.

var match = from order in customer.Orders 
    join branch in Branches 
    on order equals branch.Pending.Orders 
    select branch;

This does not work, I get :
The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to ‘GroupJoin’.

From my search, I think this is because Order or collection of Orders does not implement equals.

If this query worked, it will still be wrong, as it will return a branch if the customer’s and pending orders match exactly. I want a result if any of the order matches.

I am learning Linq, and looking for a approach to address such issues, rather than the solution itself.

I would have done this in SQL like this;

SELECT b.branch_name from Customers c, Branches b, Orders o
WHERE c.customer_id = o.customer_id
  AND o.branch_id = b.branch_id
  AND c.customer_id = 'my customer'
  AND o.order_status = 'pending'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:49:46+00:00Added an answer on May 14, 2026 at 2:49 am

    Looking at your Linq, you want something like this

    var match = 
       from o in customer.Orders 
       from b in Branches 
       where b.Pending.Orders.FirstOrDefault(p => o.order_id == p.order_id) != null
       select b;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a linq to object query in vb.net, here is the
I am trying to do the following Linq query on a Visio Masters collection:
I'm trying to perform a LINQ query on a DataTable object and bizarrely I
I'm trying to learn LINQ to SQL and I'm able to query the database
I'm trying order a Linq to NHibernate query by the sum of it's children.
I am trying to create Linq Expression that I can use to query child
i am trying to figure out how to write a linq query that will
I'm trying to perform an in query on a collection of id objects (implemented
I'm having an issue with my linq query. I am trying to filter objects
I'm trying to use LINQ To Objects to create a query that will give

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.