Skip to content
Camilo Galiana edited this page Dec 22, 2015 · 1 revision

Teams

All the examples will assume that you have created a VSO Context

var context = new VsoContext(account, username, password);

Get a list of team

Get the teams for a given projects in the account (up to 100)

var teams = await context.Teams.Where(x => x.ProjectId == project.Id).ToListAsync();

Pagination

var teams = await context.Teams.Where(x => x.ProjectId == project.Id).Skip(100).Take(25).ToListAsync();

Filter by ID

var team = await context.Teams.Where(x => x.ProjectId == project.Id && x.Id == "teamID").FirstOrDefaultAsync();

Note that the example uses a "Where" clause to filter and then a "FirstOrDefaultAsync()" to get the first element. This is due the current implementation of "FirstOrDefaultAsync".

Get a team's members

var teamembers = await context.TeamMembers.Where(x => x.ProjectId == project.Id && x.TeamId == team.Id).ToListAsync();

Clone this wiki locally