Skip to content

stusklinar/VSTS.Net

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VSTS.Net

.Net client for Visual Studio Team Services API

Build status

Nuget

Nuget

Api documentation

Usage

Console app

var query = @"SELECT [System.Id] FROM WorkItems 
        WHERE [System.WorkItemType] IN ('Bug', 'Task') AND [System.AssignedTo] Ever '[email protected]' AND System.ChangedDate >= '01/01/2018'";

var client = VstsClient.Get(instanceName: "foo", accessToken: "secure token");
var items = await client.GetWorkItemsAsync(new WorkItemsQuery(query));

Asp.Net Core

In the Startup.cs add VstsNet to the services collection

services.AddVstsNet(instanceName: "foo", accessToken: "secure token");

Now you can consume Vsts client through DI:

private readonly IVstsClient client;

public HomeController(IVstsClient client)
{
	this.client = client;
}

public async Task<IActionResult> Index()
{
    var prs = await client.GetPullRequestsAsync("MyProject", "MyRepository", new PullRequestQuery { CreatedAfter = DateTime.Now.AddDays(-5) });
}

About

REST client for Visual Studio Team Services

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%