By default, the AbpUserRole
and AbpRole
implement ISoftDelete
. Is it possible to disable it?
I tried to do this:
[AbpAuthorize(AppPermissions.Pages_Administration_Roles_Delete)]
public async Task DeleteRole(EntityDto input)
{
using (CurrentUnitOfWork.DisableFilter(AbpDataFilters.SoftDelete))
{
var role = await _roleManager.GetRoleByIdAsync(input.Id);
var users = await UserManager.GetUsersInRoleAsync(role.Name);
foreach (var user in users)
{
CheckErrors(await UserManager.RemoveFromRoleAsync(user, role.Name));
}
CheckErrors(await _roleManager.DeleteAsync(role));
}
}
Although the filter is disabled in the current unit of work, it doesn't work. The entity is marked as deleted.