.NET CORE 2 EF Include
I am using new .net core and EF. I need help with include linq command. I have some 1:N models and if the collection contais some data marked like deleted I do not want to include them. How to do it? var company = await _context.Company .Include(y => y.Administrators) .Include(y => y.CompanyPartTimers) .Include(z => z.WorkPlaces) .Include(z => z.Requirements) .FirstAsync(x => x.Id == id); If I add the condition .Include(z => z.WorkPlaces).Where(x=>x.WorkPlaces.Where(x=>!x.IsDeleted)) It doesn't work. How to write this correctly? Next thing is I have IDeletable Interface and it would be better