<PackageReference Include="Nito.AsyncEx.Tasks" Version="5.0.0" />

Nito.AsyncEx.SynchronizationContextExtensions

public static class SynchronizationContextExtensions
Provides extension methods for SynchronizationContext.
public static Task PostAsync(this SynchronizationContext this, Action action)

Asynchronously executes a delegate on this synchronization context.

public static Task<T> PostAsync<T>(this SynchronizationContext this, Func<T> action)

Asynchronously executes a delegate on this synchronization context and returns its result.

public static Task PostAsync(this SynchronizationContext this, Func<Task> action)

Asynchronously executes an asynchronous delegate on this synchronization context.

public static Task<T> PostAsync<T>(this SynchronizationContext this, Func<Task<T>> action)

Asynchronously executes an asynchronous delegate on this synchronization context and returns its result.

public static void Send(this SynchronizationContext this, Action action)

Synchronously executes a delegate on this synchronization context.

public static T Send<T>(this SynchronizationContext this, Func<T> action)

Synchronously executes a delegate on this synchronization context and returns its result.