Corrected boolean logic on bypass filter logic
This commit is contained in:
@@ -67,7 +67,7 @@ public sealed class ApplicationDbContext(DbContextOptions<ApplicationDbContext>
|
|||||||
|
|
||||||
private void ApplyGlobalTenantFilter<TEntity>(ModelBuilder modelBuilder)
|
private void ApplyGlobalTenantFilter<TEntity>(ModelBuilder modelBuilder)
|
||||||
where TEntity : class, ITenantEntity =>
|
where TEntity : class, ITenantEntity =>
|
||||||
modelBuilder.Entity<TEntity>().HasQueryFilter(e => BypassFilter == false && e.TenantId == CurrentTenantId);
|
modelBuilder.Entity<TEntity>().HasQueryFilter(e => BypassFilter || e.TenantId == CurrentTenantId);
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user