Example #1
0
        public IEnumerable <Type> GetCommandPipelineItems <TCommand>()
            where TCommand : ICommand
        {
            IEnumerable <Type> pipelineItems;

            return(commandPipelineItems.TryGetValue(typeof(TCommand).FullName, out pipelineItems)
                ? pipelineItems
                : PredefinedCommandPipelines.TransactionalCommandExecutionPipeline());
        }
Example #2
0
 public static void RegisterPredefinedCommandPipelineItems(this ContainerBuilder builder)
 {
     foreach (var item in PredefinedCommandPipelines.TransactionalCommandExecutionPipeline())
     {
         builder
         .RegisterGeneric(item)
         .InstancePerLifetimeScope();
     }
 }
Example #3
0
        public override void RegisterCommandPipelines()
        {
            var assignUserToProjectPipeline = (IEnumerable <Type>) new List <Type>
            {
                typeof(AuthorizationPipelineItem <AssignUserToProject>)
            };
            var standardPipeline = PredefinedCommandPipelines.TransactionalCommandExecutionPipeline();

            assignUserToProjectPipeline = assignUserToProjectPipeline.Concat(standardPipeline);
            var pipelineConfiguration = context.Resolve <IPipelineItemsConfiguration>();

            pipelineConfiguration.SetCommandPipeline <AssignUserToProject>(assignUserToProjectPipeline);

            var createProjectPipeline = (IEnumerable <Type>) new List <Type>
            {
                typeof(AuthorizationPipelineItem <CreateProject>)
            };

            createProjectPipeline = createProjectPipeline.Concat(standardPipeline);
            pipelineConfiguration.SetCommandPipeline <CreateProject>(createProjectPipeline);
            base.RegisterCommandPipelines();
        }
        public override void RegisterCommandPipelines()
        {
            var createUser = (IEnumerable <Type>) new List <Type>
            {
                typeof(AuthorizationPipelineItem <CreateUser>)
            };
            var standardPipeline = PredefinedCommandPipelines.TransactionalCommandExecutionPipeline();

            createUser = createUser.Concat(standardPipeline);
            var pipelineConfiguration = context.Resolve <IPipelineItemsConfiguration>();

            pipelineConfiguration.SetCommandPipeline <CreateUser>(createUser);

            var grantRole = (IEnumerable <Type>) new List <Type>
            {
                typeof(AuthorizationPipelineItem <GrantRole>)
            };

            grantRole = grantRole.Concat(standardPipeline);
            pipelineConfiguration.SetCommandPipeline <GrantRole>(grantRole);

            base.RegisterCommandPipelines();
        }