Using EF Core HasQueryFilter on navigation properties
问题 I'm trying to apply a filter to my queries for multi-tenancy but it doesn't allow me to apply the filter when the property is part of a navigation property: modelBuilder.Entity<Level>().HasQueryFilter(lvl => lvl.SchoolYear.TenantId == _tenantProvider.TenantId); Here, Level is the property I want filtered but the property to use for filtering which is TenantId is is inside Level.SchoolYear. If its a top-level property it works fine. How can I apply a global filter when the property I need for