Filtering navigation property in eager loading
问题 I have been working with soft delete and now i want to load the navigation properties of my entity that are not "deleted". I have found a way, my problem this way is not to clear for me, there is another way to do this. Context.CreateSet().Include("Salary").Select(u => new {User= u, Salary = u.Salarys.Where(s => !s.Deleted)}).AsQueryable().Select(a => a.User).AsQueryable(); 回答1: Eager loading doesn't support filtering. Your code can be simplified to: var users = Context.CreateSet<User>()