I’m having problems running a LINQ query between two tables and returning an answer set that doesen’t match.
TB_AvailableProducts -Prod_ID -Name .... TB_Purchases -Cust_ID -Prod_ID
Is there a way to get all distinct products that a customer has not purchased by using 1 LINQ query, or do I have to be doing two separate queries, 1 for all products and 1 for purchased products, and compare the two?
This query will return all products, which do not have related record in purchases table.
I don’t think you need
Distincthere if you don’t have duplicated records in your products table.Generated SQL query will look like: