entity framework - Linq query using include has too many rows -


enter image description here

i having issue getting records need 1 query using include extension.

this working:

_db.companies.where(x => x.companyid == id)                 .include(x => x.contact)                 .include(x => x.properties.select(p => p.contact))                 .include(x => x.properties.select(f => f.facilities.select(c => c.contact)))                 .include(x => x.properties.select( => f.facilities.select(s => s.sections.select(si => si.sectionideas))))                 .singleordefault(); 

this fine except entity initiates separate query each license since not including it.

since license in same query tried this:

_db.companies.where(x => x.companyid == id)                 .include(x => x.contact)                 .include(x => x.properties.select(p => p.contact))                 .include(x => x.properties.select(f => f.facilities.select(c => c.contact)))                 .include(x => x.properties.select(f => f.facilities.select(l => l.licenses)))//added                 .include(x => x.properties.select(f => f.facilities.select(s => s.sections.select(si => si.sectionideas))))                 .singleordefault(); 

this causes row returned each facility. there way license without additional rows?


Comments