目前,我对GitHub API的调用返回了回购的所有问题。
var repoIssueRequest = new RepositoryIssueRequest
{
State = itemState,// Is ItemState.Open or ItemState.Closed
Labels = new[] { label1, label2}// Trying to specify the labels I want to filter by, but there is no set, so this won't work
};
var gitRepoIssues = (_gitHubclient.Issue.GetForRepository(string owner, string repo name, repoIssueRequest)).Result.ToList();我不想仅仅指定是公开还是封闭的问题,而是通过标签。规范(此处查看)将标签指定为参数之一,但在octokit.net中,我不能指定标签列表,因为它只有getter访问器。
RepositoryIssueRequest实现IssueRequest,IssueRequest包含public Collection<string> Labels { get; }。
目前,在获取所有问题之后,我通过标签进行筛选,但是如果返回了几百个问题,那么必须返回大量的数据,然后过滤这些问题的集合。如何指定标签,以减少返回问题集合所需的时间?
发布于 2015-03-19 12:16:42
我打开了一个Octokit.net回购的问题,并得到了我的问题的答案。
var repoIssueRequest = new RepositoryIssueRequest
{
State = itemState,// Is ItemState.Open or ItemState.Closed
//Labels = new[] { label1, label2}// Don't specify label names here
};
repoIssueRequest.Labels.Add("Label1");// Repeat for label 2 and so on or use .AddRange()
var gitRepoIssues = (_gitHubclient.Issue.GetForRepository(string owner, string repo name, repoIssueRequest)).Result.ToList();我感谢shiftkey对我的问题的快速反应。
https://stackoverflow.com/questions/29141747
复制相似问题