BookStore.Utility.AsyncCommands.TaskUtilities.FireAndForgetSafeAsync C# (CSharp) Méthode

FireAndForgetSafeAsync() public static méthode

public static FireAndForgetSafeAsync ( Task task, IErrorHandler handler = null ) : void
task Task
handler IErrorHandler
Résultat void
        public static async void FireAndForgetSafeAsync(this Task task, IErrorHandler handler = null)
        {
            try
            {
                await task;
            }
            catch (Exception ex)
            {
                handler?.HandleError(ex);
            }
        }
    }