/// <summary> /// Execute the Func. /// </summary> /// <typeparam name="TClass">Class with methods.</typeparam> /// <typeparam name="TException">Type of exception of the exception handler.</typeparam> /// <typeparam name="TResult">Type of result.</typeparam> /// <param name="codeExecutorBuilder"><see cref="CodeExecutorBuilder{TClass, TException}"/>.</param> /// <param name="func">Executed Func.</param> /// <param name="defaultResult">Default result if exception will occured.</param> /// <returns> /// Returns result. /// </returns> public static TResult Start <TClass, TException, TResult>(this CodeExecutorBuilder <TClass, TException> codeExecutorBuilder, Func <TResult> func, TResult defaultResult = default) where TClass : class where TException : Exception { return(codeExecutorBuilder.Execute(func, defaultResult)); }
/// <summary> /// Execute the Action. /// </summary> /// <typeparam name="TClass">Class with methods.</typeparam> /// <typeparam name="TException">Type of exception of the exception handler.</typeparam> /// <param name="codeExecutorBuilder"><see cref="CodeExecutorBuilder{TClass, TException}"/>.</param> /// <param name="action">Executed Action.</param> /// <param name="iterations">Number of executing Action iterations.</param> public static void Start <TClass, TException>(this CodeExecutorBuilder <TClass, TException> codeExecutorBuilder, Action action, uint iterations = 1) where TClass : class where TException : Exception { codeExecutorBuilder.Execute(action, iterations); }