private static async Task <bool> CheckUserIsMemberOfGroupAsync( Guid groupId, Guid userId, IGroupMemberRepository groupMemberRepository) { var groupMember = await groupMemberRepository.FindAsync(gm => gm.GroupId == groupId && gm.UserId == userId); return(groupMember != null); }
public static async Task <bool> CheckGroupMemberExistsAsync( Guid groupId, Guid userId, IGroupMemberRepository groupMemberRepository) { var groupMember = (await groupMemberRepository.FindAsync(gm => gm.GroupId == groupId && gm.UserId == userId)).FirstOrDefault(); return(groupMember != null); }