sql - Linq Many to many -


could please linq problem.

users have list of properties , properties have list of users.

i first query properties particular companyid. makes new list we'll call myproperties.

i need tenants have property in myproperties list.

for other reasons, don't have access "propertiesusers" join table.

sorry if looks haven't thought through, i've been banging head day on it.

you can use enumerable.selectmany() flatten hierarchy:

var myproperties = dbcontext.properties.where(property => property.companyid = companyid); var tenants = myproperties.selectmany(property => property.tenants); 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -