public TDsl WithResultFactory <TFactory>(ConstraintDsl constraintDsl) where TFactory : IActionResultFactory { IActionResultFactory factory = CreateFactory <TFactory>(); return(WithResultFactory(factory, constraintDsl)); }
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); }
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); }
public TDsl WithFilter <T>(ConstraintDsl constraint) { return(WithFilter <T>(constraint.GetConstraintRegistrations(objectFactory))); }