Esempio n. 1
0
        /// <summary>
        /// Synchronously wait for the result.
        /// </summary>
        /// <typeparam name="TResult">The awaitable result type.</typeparam>
        /// <param name="AAwaitable">The <see cref="IAwaitable{TResult}"/>.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="AAwaitable"/> is <see langword="null"/>.
        /// </exception>
        public static TResult Wait <TResult>([NotNull] this IAwaitable <TResult> AAwaitable)
        {
            Require.NotNull(AAwaitable, nameof(AAwaitable));

            // NOTE: The cancellation token is useless and can neither canceled nor be disposed.
            // ReSharper disable once ExceptionNotDocumented
            return(AAwaitable.Wait(CancellationToken.None));
        }