public StateMachineSafeExecutor( IStateMachineExecutor <TState> realExecutor, Action <Exception>?handler) { _realExecutor = realExecutor.ThrowIfNull(nameof(realExecutor)); _handler = handler ?? (ex => Logger.Exception(ex)); }
public static TState Execute <TState, TStateId>( this IStateMachineExecutor <TState, TStateId> executor) where TState : class { executor.ThrowIfNull(nameof(executor)); using (var enumerator = executor.GetEnumerator()) { while (enumerator.MoveNext()) { // All actions perform in MoveNext. } } return(executor.State); }