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

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -