src/NAsync/SimpleTaskFactory.cs
/// <summary>
/// Queues the specified work to run on the ThreadPool and returns a proxy for the
/// Task(TResult) returned by <paramref name="function"/>.
/// </summary>
/// <typeparam name="TResult">The type of the result returned by the proxy Task.</typeparam>
/// <param name="function">The work to execute asynchronously</param>
/// <param name="cancellationToken">A cancellation token that should be used to cancel the work</param>
/// <returns>A Task(TResult) that represents a proxy for the Task(TResult) returned by <paramref name="function"/>.</returns>
/// <exception cref="T:System.ArgumentNullException">
/// The <paramref name="function"/> parameter was null.
/// </exception>
/// <exception cref="T:System.ObjectDisposedException">
/// The <see cref="T:System.CancellationTokenSource"/> associated with <paramref name="cancellationToken"/> was disposed.
/// </exception>
Queues the specified work to run on the ThreadPool and returns a proxy for the
Task(TResult) returned by .
Queues the specified work to run on the ThreadPool and returns a proxy for the Task ( TResult ) returned by .
[NotNull]
        public static Task<TResult> Run<TResult>([NotNull] Func<Task<TResult>> function, CancellationToken cancellationToken)
        {
            return Task.Factory.StartNew(function, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap();
        }
[ NotNull ] public static Task < TResult > Run < TResult > ( [ NotNull ] Func < Task < TResult > > function , CancellationToken cancellationToken ) { return Task . Factory . StartNew ( function , CancellationToken . None , TaskCreationOptions . None , TaskScheduler . Default ) . Unwrap ( ) ; }
Queues the specified work to run on the ThreadPool and returns a proxy for the
Task(TResult) returned by .
Queues the specified work to run on the ThreadPool and returns a proxy for the Task ( TResult ) returned by .
A Task(TResult) that represents a proxy for the Task(TResult) returned by .
A Task ( TResult ) that represents a proxy for the Task ( TResult ) returned by .
The  parameter was null.
The parameter was null .
The  associated with  was disposed.
The associated with was disposed .
Func<Task<TResult>>
[NotNull]
cancellationToken
CancellationToken
A cancellation token that should be used to cancel the work
A cancellation token that should be used to cancel the work
function
The work to execute asynchronously
The work to execute asynchronously
typeparam
The type of the result returned by the proxy Task.
The type of the result returned by the proxy Task .