Exists clause and entity structure

.net entity-framework linq

Question

I apologize for my maybe stupid inquiry; I'm new to EF.

I have two entities that are completely unrelated to one another (VS does not load the join, and I am unable to manually add it since the child's main key utilizes the parent's derived key).

Example

Object master
Products
GKey K and Product K keys
the fields.....

entity specifics
GenericInformation
keys GI K and GKey K
Product K, fields,....

Well, I have a simple inquiry (I hope my English is correct!) How can I limit my reading to items with references on GenericInformation?

TIA

Possible duplicate:
Best way to check if object exists in Entity Framework?

1
10
5/23/2017 11:52:56 AM

Popular Answer

EXISTS in SQL ~=Any using LINQ

var q = from p in Context.Products
        where Context.GenericInformation.Any(gi => gi.Product_K == p.Product_K)
        // add other columns to the where if need be; I can't tell what the 
        // relationship is supposed to be
        select p;
27
3/4/2010 1:18:16 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow