public static StateMachineSagaRepositoryConfigurator <TInstance> RemoveWhen <TInstance>( this StateMachineSagaRepositoryConfigurator <TInstance> configurator, Func <StateMachine <TInstance>, State> stateSelector) where TInstance : class, SagaStateMachineInstance { StateMachine <TInstance> stateMachine = configurator.StateMachine; State state = stateSelector(stateMachine).For <TInstance>(); configurator.RemoveWhen(x => stateMachine.InstanceStateAccessor.Get(x) == state); return(configurator); }
public static StateMachineSagaRepositoryConfigurator <TInstance> RemoveWhenFinalized <TInstance>( this StateMachineSagaRepositoryConfigurator <TInstance> configurator) where TInstance : class, SagaStateMachineInstance { return(configurator.RemoveWhen(x => x.Final)); }