I have a query like this :
var A = from c in Customers
join d in Oreders
Select new
{
CustID = c.CustID,
Oid = d.OrderID
}
So the var A contains some Customer IDs and Order IDs.
Now,
var B = from k in Shop
// In where condition, I need to take all OTHER CustomerIDs and OrderIDs from Shop which is NOT in the var A.
I have used below code, but it is not working...
var B = from k in shop1
join d in shop2 on k.ID equals d.ID
where k.ID != null && d.ID !=null &&
!(from c in A
select c.OrderID).Contains(k.OrderID) &&
!(from x in A
select x.CustID).Contains(d.CustID)
SELECT NEW
{
// variables.....
}
When I used this query I am getting all the CustomerIDs and OrderIDs....
But I need CustomerIDs and OrderIDs from B and No need to take it if those IDs are already contains in A.
HOW CAN I DO THAT in LINQ ?????
Thanks in Advance,
