Пример #1
0
        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);
        }
Пример #2
0
        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);
        }