How to get exactly all users from database

1.3k views Asked by At

In ASP.NET boilerplate project.

I have a database with users. I am using standard methods for retrieving them _userRepository.GetAll() and deleting _userRepository.Delete(id).

By default when user id deleted it is still kept in database with isDeleted field marked as true.

My question is: is there in ABP any default method that retrieves exactly all users from database, and what follows:

is there any other possibility to do this than writing stored procedure like

 SELECT * FROM dbo.AbpUsers

and using it in repository (and then in service)?

1

There are 1 answers

6
Slava Utesinov On

You should disable filter(SoftDelete):

//provided by DI
private readonly IUnitOfWorkManager _unitOfWorkManager;

using (_unitOfWorkManager.Current.DisableFilter(AbpDataFilters.SoftDelete))
//or
//using (CurrentUnitOfWork.DisableFilter(AbpDataFilters.SoftDelete))
{
    var completelyAllUsers = _userRepository.GetAllList();                
}