public async Task <PagedResultDto <OrganizationUnitUserListDto> > GetOrganizationUnitUsersAsync(GetOrganizationUnitUsersInput input) { var query = from ouUser in await _organizationUnitUserRepository .FindOrganizationUnitUsersAsync(input.Id, input.MaxResultCount, input.SkipCount).ConfigureAwait(false) join user in _userManager.Users on ouUser.UserId equals user.Id where ouUser.OrganizationUnitId == input.Id select new { ouUser, user }; var totalCount = await _organizationUnitUserRepository.GetCountAsync(input.Id); var items = query.ToList(); return(new PagedResultDto <OrganizationUnitUserListDto>( totalCount, items.Select(item => { var organizationUnitUserDto = ObjectMapper.Map <IdentityUser, OrganizationUnitUserListDto>(item.user); organizationUnitUserDto.AddedTime = item.ouUser.CreationTime; return organizationUnitUserDto; }).ToList())); }
public async Task <PagedResultDto <OrganizationUnitUserListDto> > GetOrganizationUnitUsersAsync(GetOrganizationUnitUsersInput input) { return(await _organizationUnitUserAppService.GetOrganizationUnitUsersAsync(input)); }