public async Task <UserModel> GetActiveByIdAsync(int id)
        {
            var user = await ReadRepository.GetSingleAsync(_filtersProvider.ActiveById(id), _relationsProvider.JoinRole);

            if (user == null)
            {
                throw new NotFoundException("Item was not found!");
            }

            return(Mapper.Map <UserModel>(user));
        }
Exemplo n.º 2
0
 private async Task <bool> UserExists(int id, CancellationToken cancellationToken)
 {
     return(await Task.Run(() => ReadRepository.ValidateExists(_userFiltersProvider.ActiveById(id)), cancellationToken));
 }