Beispiel #1
0
        private async Task <IMembership <TeamMembership> > FindMembershipByIdOrEmailAsync(string userIdOrEmail)
        {
            var memberships = await TeamsApi.GetTeamMembershipsAsync(Id);

            var membership = memberships.Items.FirstOrDefault(x => x.PersonEmail == userIdOrEmail || x.PersonId == userIdOrEmail);

            if (membership == null)
            {
                throw new KeyNotFoundException($"User not found by ID or Email in Team {Name} ({Id}).");
            }

            return(membership);
        }
Beispiel #2
0
 /// <inheritdoc/>
 public async Task <IListResult <TeamMembership> > GetMembershipsAsync(int max = 100)
 => await TeamsApi.GetTeamMembershipsAsync(Id, max);