/// <summary> /// Register the InMemory saga repository for the specified saga type /// </summary> /// <param name="collection"></param> /// <typeparam name="T"></typeparam> public static void RegisterInMemorySagaRepository <T>(this IServiceCollection collection) where T : class, ISaga { var registrar = new DependencyInjectionContainerRegistrar(collection); registrar.RegisterInMemorySagaRepository <T>(); }
/// <summary> /// Add the state machine sagas in the specified assembly to the service collection /// </summary> /// <param name="collection"></param> public static void RegisterSagaStateMachine <TStateMachine, TInstance>(this IServiceCollection collection) where TStateMachine : class, SagaStateMachine <TInstance> where TInstance : class, SagaStateMachineInstance { var registrar = new DependencyInjectionContainerRegistrar(collection); SagaStateMachineRegistrationCache.Register(typeof(TStateMachine), registrar); }
/// <summary> /// Add the state machine sagas by type /// </summary> /// <param name="collection"></param> /// <param name="types">If specified, only the specified assemblies are scanned</param> public static void RegisterSagaStateMachines(this IServiceCollection collection, params Type[] types) { var registrar = new DependencyInjectionContainerRegistrar(collection); registrar.RegisterSagaStateMachines(types); }
/// <summary> /// Add the state machine sagas in the specified assembly to the service collection /// </summary> /// <param name="collection"></param> /// <param name="type">The state machine saga type</param> public static void RegisterSagaStateMachine(this IServiceCollection collection, Type type) { var registrar = new DependencyInjectionContainerRegistrar(collection); SagaStateMachineRegistrationCache.Register(type, registrar); }