/// Implements <see cref="IDevOpsIntegration.PopulateUserProfile"/> public Task PopulateUserProfile() { lock (_lockObject) { return(Task.Run(async() => { if (ConnectedToAzureDevOps) { ProfileHttpClient client = _baseServerConnection.GetClient <ProfileHttpClient>(); ProfileQueryContext context = new ProfileQueryContext(AttributesScope.Core, CoreProfileAttributes.All, null); this.UserProfile = await client.GetProfileAsync(context).ConfigureAwait(false); } })); } }
/// <summary> /// Refreshes profile of current user /// </summary> internal Task PopulateUserProfile() { lock (myLock) { return(Task.Run(async() => { if (ConnectedToAzureDevOps) { // We need to use deployment level connection to get profile info var deploymentConn = new VssConnection(new Uri(BASE_VSO_URL), _baseServerConnection.Credentials); ProfileHttpClient client = deploymentConn.GetClient <ProfileHttpClient>(); ProfileQueryContext context = new ProfileQueryContext(AttributesScope.Core, CoreProfileAttributes.All, null); this.UserProfile = await client.GetProfileAsync(context).ConfigureAwait(false); } })); } }