Example #1
0
        private void SetupValueProviderFactories(IInspectorContext context)
        {
            var factories = ValueProviderFactories.Factories;
            if (factories.Count == 0)
            {
                return;
            }

            var alternateValueProviderFactory = new ValueProviderFactory(context.ProxyFactory);

            for (int i = 0; i < factories.Count; i++)
            {
                var originalFactory = factories[i];
                System.Web.Mvc.ValueProviderFactory newFactory;

                if (alternateValueProviderFactory.TryCreate(originalFactory, out newFactory))
                {
                    context.Logger.Info(Resources.ModelBinderInspectorSetupReplacedValueProviderFactory, originalFactory.GetType());
                    factories[i] = newFactory;
                }
            }
        }
        private void SetupValueProviderFactories(IInspectorContext context)
        {
            var factories = ValueProviderFactories.Factories;

            if (factories.Count == 0)
            {
                return;
            }

            var alternateValueProviderFactory = new ValueProviderFactory(context.ProxyFactory);

            for (int i = 0; i < factories.Count; i++)
            {
                var originalFactory = factories[i];
                System.Web.Mvc.ValueProviderFactory newFactory;

                if (alternateValueProviderFactory.TryCreate(originalFactory, out newFactory))
                {
                    context.Logger.Info(Resources.ModelBinderInspectorSetupReplacedValueProviderFactory, originalFactory.GetType());
                    factories[i] = newFactory;
                }
            }
        }