Remove ICurrentTenant.Clear

pull/272/head
Halil İbrahim Kalkan 7 years ago
parent a62dc37f57
commit 91725a7b90

@ -22,9 +22,9 @@ namespace Volo.Abp.EntityFrameworkCore
public abstract class AbpDbContext<TDbContext> : DbContext, IEfCoreDbContext
where TDbContext : DbContext
{
public virtual Guid? CurrentTenantId => CurrentTenant?.Id;
protected virtual Guid? CurrentTenantId => CurrentTenant?.Id;
protected virtual bool IsMayHaveTenantFilterEnabled => DataFilter.IsEnabled<IMultiTenant>();
protected virtual bool IsMultiTenantFilterEnabled => DataFilter.IsEnabled<IMultiTenant>();
protected virtual bool IsSoftDeleteFilterEnabled => DataFilter.IsEnabled<ISoftDelete>();
@ -307,7 +307,7 @@ namespace Volo.Abp.EntityFrameworkCore
* But this causes a problem with EF Core (see https://github.com/aspnet/EntityFrameworkCore/issues/9502)
* So, we made a workaround to make it working. It works same as above.
*/
Expression<Func<TEntity, bool>> multiTenantFilter = e => ((IMultiTenant)e).TenantId == CurrentTenantId || (((IMultiTenant)e).TenantId == CurrentTenantId) == IsMayHaveTenantFilterEnabled;
Expression<Func<TEntity, bool>> multiTenantFilter = e => ((IMultiTenant)e).TenantId == CurrentTenantId || (((IMultiTenant)e).TenantId == CurrentTenantId) == IsMultiTenantFilterEnabled;
expression = expression == null ? multiTenantFilter : CombineExpressions(expression, multiTenantFilter);
}

@ -21,11 +21,6 @@ namespace Volo.Abp.MultiTenancy
return SetCurrent(id);
}
public IDisposable Clear() //TODO: Remove
{
return Change(null);
}
private IDisposable SetCurrent(Guid? tenantId)
{
var parentScope = _currentTenantIdAccessor.Current;

@ -11,7 +11,5 @@ namespace Volo.Abp.MultiTenancy
Guid? Id { get; }
IDisposable Change(Guid? id);
IDisposable Clear();
}
}

Loading…
Cancel
Save