Filtering nested collections in Query()

Apr 15, 2015 at 10:15 PM
Is it possible to return a filtered results set of a nested collection? We currently soft delete rows but they are returned in the result set when using something like the following
var type = _uow.Repository<OrganisationType>()
                                    .Query(m => m.Code == typeCode && m.Deleted == false
                                            && m.OrganisationDataItems.Any(d => d.Deleted == false))
                                    .Include(m => m.OrganisationDataItems.Select(di=>di.DataField))
I have to subsequently then remove the OrganisationDataItem's that have Deleted = true.

Any help would be appreciated.
May 12, 2015 at 5:43 PM
Marked as answer by lelong37 on 5/12/2015 at 9:43 AM