I have the following model class method:-
public IQueryable<TMSSwitch> AllFindServer_Switches(int id {
return tms.TMSSwitches.Where(c => c.TMSSwitchPorts.Any(a6=>a6.TechnologyID == id))
.Include(a10 => a10.TMSSwitchPorts.Where(a=>a.TechnologyID==id).Select(a=>a.Technology))
.Include(a11 => a11.TMSServer.Technology)
;}
But I am unable to define .Where inside the .Include, as I need to only include certain records from the navigation property. But the above code will cause the following error on run-time:-
The Include path expression must refer to a navigation property defined on the type. Use dotted paths for reference navigation properties and the Select operator for collection navigation propertie
Can anyone advice, if there is a way to have .Where inside .include ?
Thanks