You can achieve this by using a wrapper around your DbContext
and overriding each entity collection with a where clause.
public class WrapperContext : YourDBContext { public override DbSet<YourEntitity> YourEntities { get { return base.YourEntities.Where(t => t.Tenant_Id == someId); } set { base.YourEntities = value; } } }
source share