/// <summary> /// Gets all teams for the given <paramref name="projectId"/>. /// </summary> /// <param name="client">The <see cref="TeamHttpClient"/> to use.</param> /// <param name="projectId">The project identifier.</param> /// <param name="pageSize">Page size to use while retrieving the projects.</param> /// <param name="userState">The user state object.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns></returns> /// <exception cref="System.ArgumentNullException"></exception> /// <exception cref="System.ArgumentException"></exception> public static Task <IList <WebApiTeam> > GetAllTeams(this TeamHttpClient client, Guid projectId, int pageSize = 10, object userState = null, CancellationToken cancellationToken = default(CancellationToken)) { if (client == null) { throw new ArgumentNullException(nameof(client)); } if (Equals(Guid.Empty, projectId)) { throw new ArgumentOutOfRangeException(nameof(projectId)); } return(client.GetAllTeams(projectId.ToString(), pageSize, userState, cancellationToken)); }
/// <summary> /// Gets all teams for the given <paramref name="project"/>. /// </summary> /// <param name="client">The <see cref="TeamHttpClient"/> to use.</param> /// <param name="project">The project.</param> /// <param name="pageSize">Page size to use while retrieving the projects.</param> /// <param name="userState">The user state object.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns></returns> /// <exception cref="System.ArgumentNullException"> /// </exception> public static Task <IList <WebApiTeam> > GetAllTeams(this TeamHttpClient client, TeamProject project, int pageSize = 10, object userState = null, CancellationToken cancellationToken = default(CancellationToken)) { if (client == null) { throw new ArgumentNullException(nameof(client)); } if (project == null) { throw new ArgumentNullException(nameof(project)); } return(client.GetAllTeams(project.Id, pageSize, userState, cancellationToken)); }