C# TeamFoundationServer。[扩展]客户端:通过获取我的订阅

C# TeamFoundationServer。[扩展]客户端:通过获取我的订阅,c#,C#,我想通过访问和更改我的TFS通知。例如,我能够获得给定变更集编号的变更集详细信息,如下所示: TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri("http://...")); tpc.EnsureAuthenticated(); var vcs = tpc.GetService<VersionControlServer>(); var changeset = vcs.GetChangeset(378

我想通过访问和更改我的TFS通知。例如,我能够获得给定变更集编号的变更集详细信息,如下所示:

TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri("http://..."));
tpc.EnsureAuthenticated();
var vcs = tpc.GetService<VersionControlServer>();
var changeset = vcs.GetChangeset(378418);
tfstreamprojectcollection tpc=新的tfstreamprojectcollection(新Uri(“http://..."));
tpc.确保重新验证();
var vcs=tpc.GetService();
var changeset=vcs.GetChangeset(378418);
我希望能够在同一个庄园访问我的通知

var ns = tpc.GetService<NotificationSubscription>();
var ns=tpc.GetService();

但是
ns
为空,所以可能不是这样。我需要做什么呢?

您可以使用TFS rest api来:

我已经测试过了,它正在工作


RESTAPI比SOAP Api更简单。要使用SOAP api,您需要使用
GetService
,请查看此案例以了解更多信息:。

我感觉,只有通过REST api才能使用通知。这是真的吗?RESTAPI比SOAP Api更简单。要使用SOAPAPI,您需要使用
GetService
,检查这种情况:将其作为回复而不是注释发布,我可以将其标记为回复。
PATCH http://TFS2017:8080/tfs/DefaultCollection/_apis/notification/subscriptions/{subscriptionId}?api-version=3.2-preview

Content-Type: application/json

{
 ...
}