| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | using System.Threading; |
| | | 5 | | using System.Threading.Tasks; |
| | | 6 | | using Microsoft.Identity.Client; |
| | | 7 | | |
| | | 8 | | namespace Azure.Identity |
| | | 9 | | { |
| | | 10 | | internal static class AbstractAcquireTokenParameterBuilderExtensions |
| | | 11 | | { |
| | | 12 | | public static async Task<AuthenticationResult> ExecuteAsync<T>(this AbstractAcquireTokenParameterBuilder<T> buil |
| | | 13 | | where T : AbstractAcquireTokenParameterBuilder<T> |
| | | 14 | | { |
| | 172 | 15 | | Microsoft.Identity.Client.AuthenticationResult result = async |
| | 172 | 16 | | ? await builder.ExecuteAsync(cancellationToken).ConfigureAwait(false) |
| | 172 | 17 | | #pragma warning disable AZC0102 // Do not use GetAwaiter().GetResult(). Use the TaskExtensions.EnsureCompleted() extensi |
| | 172 | 18 | | : builder.ExecuteAsync(cancellationToken).GetAwaiter().GetResult(); |
| | | 19 | | #pragma warning restore AZC0102 // Do not use GetAwaiter().GetResult(). Use the TaskExtensions.EnsureCompleted() extensi |
| | | 20 | | |
| | 136 | 21 | | return result; |
| | 136 | 22 | | } |
| | | 23 | | } |
| | | 24 | | } |