Linq to Entity Framework return a list of parents with only a subset or empty collection of children
问题 Given a list of parents and their children I want to return a list of all parents and only their male children. This is trivial in a sql query. The problem I have is with Linq to EF I cannot seem to get the query to work in any fashion. Due to EF limitations I cannot do an include to ensure the return of the Children I want. How do I accomplish the below sql in LINQ to return my Parent Entity with Children Collection with only males or Empty collections ignoring all of the female records? SQL