public async Task <IList <GetUserGroupsDto> > GetGroupsByUserIdAsync(int userId) { using (UnitOfWorkProvider.Create()) { return(await _userGroupService.GetGroupsByUserIdAsync(userId, null)); } }
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); } }