there is a context configured to filter requests, how to change the filter value at run time, without restarting the application? WorkspaceId changed by user

protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity<BaseItem>() .HasQueryFilter(u => !u.Deleted && u.WorkspaceId == Session.CurrentWorkspaceId); modelBuilder.Entity<Shipment>() .HasQueryFilter(u => !u.Deleted && u.WorkspaceId == Session.CurrentWorkspaceId); modelBuilder.Entity<Alias>() .HasQueryFilter(u => u.WorkspaceId == Session.CurrentWorkspaceId); } 
  • I doubt that this should be done here, but what prevents you from passing parameters to the context constructor? - pasha goroshko pm

0