Table of Contents

Class AsyncHelper

Namespace
JJMasterData.Core.Tasks
Assembly
JJMasterData.Core.dll

Class to safely run async methods on sync environments like ASP.NET without deadlocks.

public static class AsyncHelper
Inheritance
AsyncHelper
Inherited Members

Methods

RunSync(Func<Task>)

Execute is an async Task method which has a void return value synchronously

public static void RunSync(Func<Task> task)

Parameters

task Func<Task>

Task method to execute.

RunSync<T>(Func<Task<T>>)

Execute is an async Task method which has a T return type synchronously

public static T RunSync<T>(Func<Task<T>> task)

Parameters

task Func<Task<T>>

Task method to execute

Returns

T

Type Parameters

T

Return Type

RunSync<T>(Func<ValueTask<T>>)

public static T RunSync<T>(Func<ValueTask<T>> task)

Parameters

task Func<ValueTask<T>>

Returns

T

Type Parameters

T

RunSync<T>(Func<ValueTask>)

public static void RunSync<T>(Func<ValueTask> task)

Parameters

task Func<ValueTask>

Type Parameters

T