Ejemplo n.º 1
0
        public ActionDescriptor AddItemWithActionDescriptor<T>(Expression<Func<T, object>> func)
            where T : Controller
        {
            var actionDescriptor = func.CreateActionDescriptor();
            var constraint = PredefinedConstraint.True;
            inner.Add(new ActionResultRegistryItem(typeof(TestActionResultFactory), constraint, actionDescriptor, actionDescriptor.ControllerDescriptor));

            return actionDescriptor;
        }
Ejemplo n.º 2
0
        public virtual TDsl WithResultFactory(IActionResultFactory factory, ConstraintDsl constraintDsl)
        {
            var constraint = constraintDsl.GetConstraintRegistrations(objectFactory);

            factory.SetConstraints(constraint.Select(x => x.Constraint));

            actionResultRegistry.Add(new ActionResultRegistryItem(factory));

            return((TDsl)this);
        }