Innovt Platform
Search Results for

    Show / Hide Table of Contents

    Class AsyncHelper

    Reference https://cpratt.co/async-tips-tricks/

    Inheritance
    object
    AsyncHelper
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Innovt.Core.Utilities
    Assembly: Innovt.Core.dll
    Syntax
    public static class AsyncHelper

    Methods

    | Edit this page View Source

    RunSync(Func<Task>, CancellationToken)

    Runs an asynchronous action synchronously.

    Declaration
    public static void RunSync(Func<Task> func, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Func<Task> func

    The asynchronous action to run synchronously.

    CancellationToken cancellationToken

    An optional cancellation token for the operation.

    | Edit this page View Source

    RunSync<TResult>(Func<Task<TResult>>, CancellationToken)

    Runs an asynchronous function synchronously and returns its result.

    Declaration
    public static TResult RunSync<TResult>(Func<Task<TResult>> func, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Func<Task<TResult>> func

    The asynchronous function to run synchronously.

    CancellationToken cancellationToken

    An optional cancellation token for the operation.

    Returns
    Type Description
    TResult

    The result of the asynchronous function.

    Type Parameters
    Name Description
    TResult

    The type of the result returned by the asynchronous function.

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX