Ejemplo n.º 1
0
        private static IConstraint CreateActionConstraint <TController>(ActionDescriptor actionDescriptor)
        {
            var controllerTypeConstraint = new ControllerTypeConstraint <TController>();
            var actionConstraint         = new ControllerActionConstraint(actionDescriptor);
            var contContraint            = new AndConstraint(controllerTypeConstraint, actionConstraint);

            return(contContraint);
        }
Ejemplo n.º 2
0
        public virtual ConstraintDsl <TDsl> ExceptFor <TController>(Expression <Func <TController, object> > func) where TController : Controller
        {
            var actionDescriptor         = func.CreateActionDescriptor();
            var controllerTypeConstraint = new ControllerTypeConstraint <TController>();
            var actionConstraint         = new ControllerActionConstraint(actionDescriptor);
            var contContraint            = new AndConstraint(controllerTypeConstraint, actionConstraint);

            AddRegistration(CreateInstanceRegistration(new NotConstraint(contContraint), actionDescriptor, actionDescriptor.ControllerDescriptor, FilterScope.Action));
            return(this);
        }