1

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)?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Dawid
  • 153
  • 3
  • 18
  • had you found any solution?? then share please, I am having same issue – Mesam Mujtaba Sep 08 '17 at 12:30
  • No, filters did not work. I wrote my own stored procedure, and retrieved all users from database using it with proper entities and DTOs (just like any other stored procedure that is not default for ABP repositories). – Dawid Sep 08 '17 at 13:41

1 Answers1

0

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();                
}
Slava Utesinov
  • 13,410
  • 2
  • 19
  • 26
  • Do I need an assembly or reference to use it? I'm trying, but there is an error: `Abp.Domain.Uow.IActiveUnitOfWork' does not contain a definition for 'DisableFilter' and no extension method 'DisableFilter' accepting a first argument of type 'Abp.Domain.Uow.IActiveUnitOfWork' could be found (are you missing a using directive or an assembly reference?) ` The other error: `The name 'AbpDataFilters' does not exist in the current context` – Dawid Aug 29 '17 at 09:22
  • @Dawid, they all from `Abp.Domain.Uow` namespace from `Abp` assembly – Slava Utesinov Aug 29 '17 at 09:28
  • So why such error appears if I am `using Abp.Domain.Uow`? – Dawid Aug 29 '17 at 09:34
  • @Dawid, what is your version of `Abp`? – Slava Utesinov Aug 29 '17 at 10:15
  • Dynamic filters appeared only since `0.5.10.0` version. – Slava Utesinov Aug 29 '17 at 10:24
  • @MesamMujtaba, can you explain more specifically, what not working? – Slava Utesinov Sep 08 '17 at 13:52