Esempio n. 1
0
        public static FinerGrainedActionSelector CreateFinerGrainedActionSelector(
            IActionDescriptorCollectionProvider actionDescriptorCollectionProvider,
            IActionConstraintProvider[] actionConstraintProviders,
            ILoggerFactory loggerFactory = null)
        {
            loggerFactory = loggerFactory ?? NullLoggerFactory.Instance;

            return(new FinerGrainedActionSelector(
                       actionDescriptorCollectionProvider,
                       GetActionConstraintCache(actionConstraintProviders),
                       ModelingBindingParameterBinderTestBase.CreateParameterBinder(),
                       TestModelBinderFactory.CreateDefault(),
                       TestModelMetadataProvider.CreateDefaultProvider(),
                       ModelingBindingParameterBinderTestBase.MvcOptionsWrapper,
                       loggerFactory));
        }
Esempio n. 2
0
        public static FinerGrainedActionSelector CreateFinerGrainedActionSelector(
            IReadOnlyList <ActionDescriptor> actions,
            ILoggerFactory loggerFactory = null)
        {
            loggerFactory = loggerFactory ?? NullLoggerFactory.Instance;

            var actionProvider = CreateMockIActionDescriptorCollectionProvider(actions);

            var actionConstraintProviders = new IActionConstraintProvider[] {
                new DefaultActionConstraintProvider(),
                new BooleanConstraintProvider(),
            };

            return(new FinerGrainedActionSelector(
                       actionProvider.Object,
                       GetActionConstraintCache(actionConstraintProviders),
                       ModelingBindingParameterBinderTestBase.CreateParameterBinder(),
                       TestModelBinderFactory.CreateDefault(),
                       TestModelMetadataProvider.CreateDefaultProvider(),
                       ModelingBindingParameterBinderTestBase.MvcOptionsWrapper,
                       loggerFactory));
        }