public ICollection <GroupWRoleViewModel> GetAll(int userId) { var groups = _groupMemberRepository.Get(g => g.UserId == userId).ToList(); ICollection <GroupWRoleViewModel> groupViewModels = new List <GroupWRoleViewModel>(); foreach (var group in groups) { groupViewModels.Add(group.ToViewModel()); } return(groupViewModels); }
/// <summary> /// 是否群主 /// </summary> /// <param name="groupId">群组Id</param> /// <param name="userId">用户Id</param> /// <returns>是群主返回true,否则返回false</returns> public GroupMember GetGroupMember(long memberId) { return(groupMemberRepository.Get(memberId)); }
public List <GroupMember> GetGroupMember(int userId) { var data = _repository.Get(c => c.UserId == userId).ToList(); return(data); }