Ejemplo n.º 1
0
        protected override Task <IHandlerInstance> RunAsync(Execution <HandleContext, IHandlerInstance> execution)
        {
            IServiceScope    scope   = ScopedMessageWorkflow.GetScope(execution.Context);
            IHandlerInstance handler = new DefaultHandlerInstance(scope.ServiceProvider.GetRequiredService(execution.Context.HandlerType));

            return(Task.FromResult(handler));
        }
Ejemplo n.º 2
0
        public IWorkflow GetWorkflow()
        {
            var messageHandleWorkflow = new MessageHandleWorkflow(new CreateScopedHandlerWorkflow());
            var scopedWorkflow        = new ScopedMessageWorkflow(serviceProvider, messageHandleWorkflow, tenantResolver);

            messageHandleWorkflow.Finalize.Use(new ProjectionsWorkflow(x => ScopedMessageWorkflow.GetScope(x).ServiceProvider.GetRequiredService <IProjectionWriter>()));
            var projectionsWorkflow = new InMemoryRetryWorkflow <HandleContext>(scopedWorkflow);

            return(projectionsWorkflow);
        }
Ejemplo n.º 3
0
        protected override IHandlerInstance Run(Execution <HandleContext, IHandlerInstance> execution)
        {
            IServiceScope scope = ScopedMessageWorkflow.GetScope(execution.Context);

            return(new DefaultHandlerInstance(scope.ServiceProvider.GetRequiredService(execution.Context.HandlerType)));
        }