/// <summary> /// Invoke an action with the state machine instance and the body of the message event /// </summary> /// <typeparam name="TWorkflow"></typeparam> /// <typeparam name="TInstance"></typeparam> /// <typeparam name="TBody"></typeparam> /// <param name="activityConfigurator"></param> /// <param name="eventAction"></param> /// <returns></returns> public static ActivityConfigurator <TWorkflow, TInstance, TBody> Then <TWorkflow, TInstance, TBody>( this ActivityConfigurator <TWorkflow, TInstance, TBody> activityConfigurator, Action <TInstance, TBody> eventAction) where TWorkflow : class where TInstance : class { var configurator = new DelegateInstanceBodyConfigurator <TWorkflow, TInstance, TBody>(eventAction); activityConfigurator.AddConfigurator(configurator); return(activityConfigurator); }
public static MessageExceptionConfigurator <TWorkflow, TInstance, TException, TBody> Then <TWorkflow, TInstance, TException, TBody>( this MessageExceptionConfigurator <TWorkflow, TInstance, TException, TBody> exceptionConfigurator, Action <TInstance, TBody> action) where TWorkflow : class where TInstance : class where TException : Exception { var configurator = new DelegateInstanceBodyConfigurator <TWorkflow, TInstance, TBody>(action); exceptionConfigurator.AddConfigurator(configurator); return(exceptionConfigurator); }
public static ActivityConfigurator <TWorkflow, TInstance, Request <TRequest> > Respond <TWorkflow, TInstance, TRequest>( this ActivityConfigurator <TWorkflow, TInstance, Request <TRequest> > activityConfigurator) where TWorkflow : class where TInstance : class { var configurator = new DelegateInstanceBodyConfigurator <TWorkflow, TInstance, Request <TRequest> >((instance, request) => { request.Respond(); }); activityConfigurator.AddConfigurator(configurator); return(activityConfigurator); }
public static ActivityConfigurator <TWorkflow, TInstance, Request <TRequest> > Respond <TWorkflow, TInstance, TRequest, TResponse>( this ActivityConfigurator <TWorkflow, TInstance, Request <TRequest> > activityConfigurator, Func <Request <TRequest>, TResponse> getResponse) where TWorkflow : class where TInstance : class { var configurator = new DelegateInstanceBodyConfigurator <TWorkflow, TInstance, Request <TRequest> >((instance, request) => { TResponse response = getResponse(request); request.Respond(response); }); activityConfigurator.AddConfigurator(configurator); return(activityConfigurator); }