8 Answer(s)
-
0
There are three filters defined (as static consts on the AbpDataFilter class):
-
"SoftDelete" for entities implement ISoftDelete
-
"MustHaveTenant" for entities implement IMustHaveTenant
-
"MayHaveTenant" for entities implement IMayHaveTenant
You can inject IUnitOfWorkManager and use IUnitOfWorkManager.Current.DisableFilter(AbpDataFilter.SoftDelete) for example.
I'm working on the system, I'll document it soon.
-
-
0
what if i wanted to disable it in the app startup or enable/disable it in run time for the whole application
-
0
It's in the roadmap: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/427">https://github.com/aspnetboilerplate/as ... issues/427</a>
-
0
Good day. How can I use dynamic Filter or disable it in migration, when I use dbContext? Thanks
-
0
If you have a DbContext, just simple use context.DisableFilter extension method. See docs: <a class="postlink" href="https://github.com/jcachat/EntityFramework.DynamicFilters">https://github.com/jcachat/EntityFramew ... micFilters</a>
-
0
I set Configuration.MultiTenancy.IsEnabled = true
and _userManager.LoginAsync with Tonent works
But _dbContext.DisableAllFilters() doesn't work:
exec sp_executesql N'SELECT TOP (1)
[Extent1].[Id] AS [Id],
[Extent1].[TenantId] AS [TenantId],
[Extent1].[Name] AS [Name],
[Extent1].[DisplayName] AS [DisplayName],
[Extent1].[IsStatic] AS [IsStatic],
[Extent1].[IsDefault] AS [IsDefault],
[Extent1].[IsDeleted] AS [IsDeleted],
[Extent1].[DeleterUserId] AS [DeleterUserId],
[Extent1].[DeletionTime] AS [DeletionTime],
[Extent1].[LastModificationTime] AS [LastModificationTime],
[Extent1].[LastModifierUserId] AS [LastModifierUserId],
[Extent1].[CreationTime] AS [CreationTime],
[Extent1].[CreatorUserId] AS [CreatorUserId]
FROM [dbo].[AbpRoles] AS [Extent1]
WHERE ((([Extent1].[TenantId] IS NULL) AND (@DynamicFilterParam_MayHaveTenant_tenantId IS NULL)) OR (([Extent1].[TenantId] IS NOT NULL) AND ([Extent1].[TenantId] = @DynamicFilterParam_MayHaveTenant_tenantId)) OR (@DynamicFilterParam_MayHaveTenant_DynamicFilterIsDisabled IS NOT NULL)) AND (([Extent1].[IsDeleted] = @DynamicFilterParam_SoftDelete_IsDeleted) OR (@DynamicFilterParam_SoftDelete_DynamicFilterIsDisabled IS NOT NULL)) AND ([Extent1].[TenantId] = @p__linq__0) AND (N''Admin'' = [Extent1].[Name])',N'@DynamicFilterParam_MayHaveTenant_tenantId int,@DynamicFilterParam_MayHaveTenant_DynamicFilterIsDisabled bit,@DynamicFilterParam_SoftDelete_IsDeleted bit,@DynamicFilterParam_SoftDelete_DynamicFilterIsDisabled bit,@p__linq__0 int',@DynamicFilterParam_MayHaveTenant_tenantId=0,@DynamicFilterParam_MayHaveTenant_DynamicFilterIsDisabled=NULL,@DynamicFilterParam_SoftDelete_IsDeleted=0,@DynamicFilterParam_SoftDelete_DynamicFilterIsDisabled=NULL,@p__linq__0=1Please advise. Thanks
-
0
I found a solution for my situation:
I call _dbContext.InitializeDynamicFilters();
then
_dbContext.SetFilterScopedParameterValue(AbpDataFilters.MustHaveTenant, true);
_dbContext.SetFilterScopedParameterValue(AbpDataFilters.MayHaveTenant, true);And select from Users returns values.
But why _dbContext.DisableAllFilters() doesn't work - for me it's question...
Thanks -
0
Hi,
Where are you calling BbContext methods? Because, it's encapsulated by ABP as default. Are you using in repository? Can you share the code?