/// <summary> /// получение членов команды /// </summary> /// <param name="tfsIdentity">авторизация в TFS</param> /// <returns></returns> public IEnumerable <IdentityRef> GetTeamMembers(TfsIdentity tfsIdentity) { using (TeamHttpClient teamHttpClient = VssConnection.GetConnection().GetClient <TeamHttpClient>()) { return(teamHttpClient.GetTeamMembers(tfsIdentity.ProjectId.ToString(), tfsIdentity.TeamId.ToString()).ConfigureAwait(false).GetAwaiter().GetResult()); } }
public IEnumerable <IdentityRef> GetTeamMembers() { Guid projectId = ClientSampleHelpers.FindAnyProject(this.Context).Id; Guid teamId = ClientSampleHelpers.FindAnyTeam(this.Context, projectId).Id; VssConnection connection = Context.Connection; TeamHttpClient teamClient = connection.GetClient <TeamHttpClient>(); IEnumerable <IdentityRef> teamMembers = teamClient.GetTeamMembers(projectId.ToString(), teamId.ToString()).Result; Console.WriteLine("Members of {0}:", teamId); foreach (var member in teamMembers) { Console.WriteLine(" " + member.DisplayName); } return(teamMembers); }