зеркало из
1
0
Форкнуть 0

Merge pull request #20 from tquinn86/users/tquinn/fixes

Sample fixes
This commit is contained in:
Will Smythe 2017-06-06 17:22:39 -04:00 коммит произвёл GitHub
Родитель a9be09442c 8da2e58ebb
Коммит fc7960a62c
5 изменённых файлов: 14 добавлений и 12 удалений

Просмотреть файл

@ -75,17 +75,17 @@ namespace Microsoft.TeamServices.Samples.Client
DirectoryInfo baseOutputPath;
if (ClientSampleContext.CurrentContext.TryGetValue<DirectoryInfo>(PropertyOutputFilePath, out baseOutputPath))
{
Dictionary<string, string> requestHeaders = new Dictionary<string, string>();
Dictionary<string, IEnumerable<string>> requestHeaders = new Dictionary<string, IEnumerable<string>>();
foreach (var h in request.Headers.Where(kvp => { return !s_excludedHeaders.Contains(kvp.Key); }))
{
requestHeaders[h.Key] = h.Value.First();
requestHeaders[h.Key] = h.Value;
}
Dictionary<string, string> responseHeaders = new Dictionary<string, string>();
Dictionary<string, IEnumerable<string>> responseHeaders = new Dictionary<string, IEnumerable<string>>();
foreach (var h in response.Headers.Where(kvp => { return !s_excludedHeaders.Contains(kvp.Key); }))
{
responseHeaders[h.Key] = h.Value.First();
responseHeaders[h.Key] = h.Value;
}
dynamic requestBody = null;
@ -206,7 +206,7 @@ namespace Microsoft.TeamServices.Samples.Client
public String RequestUrl;
[DataMember]
public Dictionary<String, String> RequestHeaders;
public Dictionary<String, IEnumerable<String>> RequestHeaders;
[DataMember(EmitDefaultValue = false)]
public Object RequestBody;
@ -215,7 +215,7 @@ namespace Microsoft.TeamServices.Samples.Client
public int StatusCode;
[DataMember]
public Dictionary<String, String> ResponseHeaders;
public Dictionary<String, IEnumerable<String>> ResponseHeaders;
[DataMember(EmitDefaultValue = false)]
public Object ResponseBody;

Просмотреть файл

@ -157,6 +157,8 @@ namespace Microsoft.TeamServices.Samples.Client
}
catch (Exception ex)
{
//the innermost exception is the interesting one
while (ex.InnerException != null) ex = ex.InnerException;
Console.WriteLine("FAILED! With exception: " + ex.Message);
}
finally

Просмотреть файл

@ -358,13 +358,13 @@ namespace Microsoft.TeamServices.Samples.Client.Notification
NotificationHttpClient notificationClient = connection.GetClient<NotificationHttpClient>();
IEnumerable<NotificationSubscription> subscriptions = notificationClient.QuerySubscriptionsAsync(query).Result;
var subscriptionsByTeam = subscriptions.GroupBy<NotificationSubscription, Guid>(sub => { return Guid.Parse(sub.Subscriber.Id); });
var subscriptionsBySubscriber = subscriptions.GroupBy<NotificationSubscription, Guid>(sub => { return Guid.Parse(sub.Subscriber.Id); });
foreach (var group in subscriptionsByTeam)
foreach (var team in teams)
{
// Find the corresponding team for this group
WebApiTeam team = teams.First(t => { return t.Id.Equals(group.Key); });
var group = subscriptionsBySubscriber.First(t => t.Key == team.Id);
// Show the details for each subscription owned by this team
foreach (NotificationSubscription subscription in group)
{

Просмотреть файл

@ -15,7 +15,7 @@ namespace Microsoft.TeamServices.Samples.Client.WorkItemTracking
public QueryHierarchyItem GetQueryByName()
{
string project = ClientSampleHelpers.FindAnyProject(this.Context).Name;
string queryName = "Shared Queries/Current Sprint";
string queryName = "Shared Queries/Feedback";
VssConnection connection = Context.Connection;
WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient<WorkItemTrackingHttpClient>();

Просмотреть файл

@ -186,7 +186,7 @@ namespace Microsoft.TeamServices.Samples.Client.WorkItemTracking
// Create the new work item
WorkItem newWorkItem = workItemTrackingClient.CreateWorkItemAsync(patchDocument, project.Id, "Task").Result;
Console.WriteLine("Created work item ID {0} (1}", newWorkItem.Id, newWorkItem.Fields["System.Title"]);
Console.WriteLine("Created work item ID {0} {1}", newWorkItem.Id, newWorkItem.Fields["System.Title"]);
// Save this newly created for later samples
Context.SetValue<WorkItem>("$newWorkItem", newWorkItem);