public RetrieveStateMachineMiddleware(IStateMachineActivator stateMachineActivator, RetrieveStateMachineOptions options = null) { _stateMachineActivator = stateMachineActivator ?? throw new ArgumentNullException(nameof(stateMachineActivator)); ModelIdFunc = options?.ModelIdFunc ?? (context => context.Get(StateMachineKey.ModelId, Guid.NewGuid())); StateMachineTypeFunc = options?.StateMachineTypeFunc ?? (context => context.Get <Type>(StateMachineKey.Type)); StateMachineFunc = options?.StateMachineFunc; PostExecuteAction = options?.PostExecuteAction; }
public RetrieveStateMachineMiddleware(IStateMachineActivator stateMachineRepo, RetrieveStateMachineOptions options = null) { _stateMachineRepo = stateMachineRepo; ModelIdFunc = options?.ModelIdFunc ?? (context => context.Get(StateMachineKey.ModelId, Guid.NewGuid())); StateMachineTypeFunc = options?.StateMachineTypeFunc ?? (context => context.Get <Type>(StateMachineKey.Type)); StateMachineFunc = options?.StateMachineFunc; PostExecuteAction = options?.PostExecuteAction; }
public PersistModelMiddleware(IStateMachineActivator stateMachineRepo) { _stateMachineRepo = stateMachineRepo; }
public PersistModelMiddleware(IStateMachineActivator stateMachineActivator) { _stateMachineActivator = stateMachineActivator ?? throw new ArgumentNullException(nameof(stateMachineActivator)); }