I have a database with no contraint and no foreign key defined between table. I use Linqpad but in my Linqpad I have no navigation properties on this database.
I would like to do this
Order_Sub_Items.GroupBy(x => x.Order_Item_Id)
.Where(y => y.Items.Sub_Item_Id != y.Items.First().Sub_Item_Id)
So, in English: I would like to get all my Order_Sub_Items where for a same Order_Item_Id I have differents Sub_Item_Id.
So the idea is to group by Order_Sub_Items then for each items inside my group I compare the Sub_Item_Id to the Sub_Item_Id of my first element.
The query is not working because I cannot access Items. Why ? When I run only the first part:
Order_Sub_Items.GroupBy(x => x.Order_Item_Id)
in Linqpad I have no problem to see the result on 2 columns. Key and Items.