コード例 #1
0
 public async Task <IList <GetUserGroupsDto> > GetGroupsByUserIdAsync(int userId)
 {
     using (UnitOfWorkProvider.Create())
     {
         return(await _userGroupService.GetGroupsByUserIdAsync(userId, null));
     }
 }
コード例 #2
0
        public async Task <BasicUserDto> GetBasicUserWithGroups(int userId)
        {
            using (UnitOfWorkProvider.Create())
            {
                var groups = await _getUserGroupsService.GetGroupsByUserIdAsync(userId, true);

                var groupsInvitedInto = await _getUserGroupsService.GetGroupsByUserIdAsync(userId, false);

                var user = await _basicUsersService.GetAsync(userId);

                var groupDtos = groups.ToList();
                groupDtos.AddRange(groupsInvitedInto);

                user.Groups = groupDtos;

                return(user);
            }
        }