Beispiel #1
0
        private void modifyNewAction(ActionCallSet actions)
        {
            var newAction = actions.ByName("New");

            if (newAction == null)
            {
                return;
            }
            // Set the url categorization and the route
            var chain = newAction.ParentChain();

            chain.UrlCategory.Creates.Add(_entityType);
            chain.Route = new RouteDefinition(_routeName + "/new");
        }
        public void Configure(BehaviorGraph graph)
        {
            var crudActions = graph.Behaviors.Select(x => x.FirstCall()).Where(x => x != null)
                .Where(x => x.HandlerType.IsCrudController())
                .GroupBy(x => x.HandlerType);

            crudActions
                .Each(group =>
                {
                    var actions = new ActionCallSet(group);
                    var modifier = new CrudActionModifier(CrudTypeExtensions.GetEntityType(group.Key), CrudTypeExtensions.GetEditEntityModelType(group.Key));
                    modifier.ModifyChains(actions, graph);
                });
        }
        public void Configure(BehaviorGraph graph)
        {
            var crudActions = graph.Behaviors.Select(x => x.FirstCall()).Where(x => x != null)
                              .Where(x => x.HandlerType.IsCrudController())
                              .GroupBy(x => x.HandlerType);


            crudActions
            .Each(group =>
            {
                var actions  = new ActionCallSet(group);
                var modifier = new CrudActionModifier(CrudTypeExtensions.GetEntityType(group.Key), CrudTypeExtensions.GetEditEntityModelType(group.Key));
                modifier.ModifyChains(actions, graph);
            });
        }
Beispiel #4
0
        public void ModifyChains(ActionCallSet actions, BehaviorGraph graph)
        {
            // Attach the creation handlers
            actions.ForOutput(x => x.Closes(typeof(CreationRequest <>))).Each(addCreatorCall);

            // Attach the creation permissions
            actions.StartingWith("Create").Each(addCreationPermission);
            actions.StartingWith("New").Each(addCreationPermission);

            // Mark the New method as the 'new' url for that entity type
            modifyNewAction(actions);

            // Flesh out the behavior chains for "New" chains
            actions.StartingWith("New").Each(addNewEntityPipeline);

            // add the Find and EditProperty endpoints
            addEndpointsFor(_entityType, graph);

            // Attach more behaviors and security for the Edit endpoints
            modifyEditAction(actions.ByName("Edit"));
        }
Beispiel #5
0
        public void ModifyChains(ActionCallSet actions, BehaviorGraph graph)
        {
            // Attach the creation handlers
            actions.ForOutput(x => x.Closes(typeof(CreationRequest<>))).Each(addCreatorCall);

            // Attach the creation permissions
            actions.StartingWith("Create").Each(addCreationPermission);
            actions.StartingWith("New").Each(addCreationPermission);

            // Mark the New method as the 'new' url for that entity type
            modifyNewAction(actions);

            // Flesh out the behavior chains for "New" chains
            actions.StartingWith("New").Each(addNewEntityPipeline);

            // add the Find and EditProperty endpoints
            addEndpointsFor(_entityType, graph);

            // Attach more behaviors and security for the Edit endpoints
            modifyEditAction(actions.ByName("Edit"));
        }
Beispiel #6
0
 private void modifyNewAction(ActionCallSet actions)
 {
     var newAction = actions.ByName("New");
     if (newAction == null) return;
     // Set the url categorization and the route
     var chain = newAction.ParentChain();
     chain.UrlCategory.Creates.Add(_entityType);
     chain.Route = new RouteDefinition(_routeName + "/new");
 }