예제 #1
0
        public TDsl WithResultFactory <TFactory>(ConstraintDsl constraintDsl)
            where TFactory : IActionResultFactory
        {
            IActionResultFactory factory = CreateFactory <TFactory>();

            return(WithResultFactory(factory, constraintDsl));
        }
예제 #2
0
        public TDsl WithFilter <T>(T filterInstance, ConstraintDsl constraint)
        {
            IEnumerable <TransientRegistration> registrations = constraint.GetConstraintRegistrations(objectFactory);

            RegisterFilter(filterInstance.GetType(), registrations.Select(x => new FilterInstanceInstanceRegistration(x.Constraint, x.ActionDescriptor, x.ControllerDescriptor, filterInstance, x.Scope)));

            return((TDsl)this);
        }
예제 #3
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);
        }
예제 #4
0
 public TDsl WithFilter <T>(ConstraintDsl constraint)
 {
     return(WithFilter <T>(constraint.GetConstraintRegistrations(objectFactory)));
 }