Ejemplo n.º 1
0
        public DefaultBindingMetadataProvider(ModelBindingMessageProvider messageProvider)
        {
            if (messageProvider == null)
            {
                throw new ArgumentNullException(nameof(messageProvider));
            }

            _messageProvider = messageProvider;
        }
        public DefaultBindingMetadataProvider(ModelBindingMessageProvider messageProvider)
        {
            if (messageProvider == null)
            {
                throw new ArgumentNullException(nameof(messageProvider));
            }

            _messageProvider = messageProvider;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ModelBindingMessageProvider"/> class based on
        /// <paramref name="originalProvider"/>.
        /// </summary>
        /// <param name="originalProvider">The <see cref="ModelBindingMessageProvider"/> to duplicate.</param>
        public ModelBindingMessageProvider(ModelBindingMessageProvider originalProvider)
        {
            if (originalProvider == null)
            {
                throw new ArgumentNullException(nameof(originalProvider));
            }

            MissingBindRequiredValueAccessor = originalProvider.MissingBindRequiredValueAccessor;
            MissingKeyOrValueAccessor = originalProvider.MissingKeyOrValueAccessor;
            ValueMustNotBeNullAccessor = originalProvider.ValueMustNotBeNullAccessor;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ModelBindingMessageProvider"/> class based on
        /// <paramref name="originalProvider"/>.
        /// </summary>
        /// <param name="originalProvider">The <see cref="ModelBindingMessageProvider"/> to duplicate.</param>
        public ModelBindingMessageProvider(ModelBindingMessageProvider originalProvider)
        {
            if (originalProvider == null)
            {
                throw new ArgumentNullException(nameof(originalProvider));
            }

            MissingBindRequiredValueAccessor = originalProvider.MissingBindRequiredValueAccessor;
            MissingKeyOrValueAccessor        = originalProvider.MissingKeyOrValueAccessor;
            ValueMustNotBeNullAccessor       = originalProvider.ValueMustNotBeNullAccessor;
        }
Ejemplo n.º 5
0
 public MvcOptions()
 {
     CacheProfiles = new Dictionary<string, CacheProfile>(StringComparer.OrdinalIgnoreCase);
     Conventions = new List<IApplicationModelConvention>();
     Filters = new FilterCollection();
     FormatterMappings = new FormatterMappings();
     InputFormatters = new FormatterCollection<IInputFormatter>();
     OutputFormatters = new FormatterCollection<IOutputFormatter>();
     ModelBinders = new List<IModelBinder>();
     ModelBindingMessageProvider = new ModelBindingMessageProvider();
     ModelMetadataDetailsProviders = new List<IMetadataDetailsProvider>();
     ModelValidatorProviders = new List<IModelValidatorProvider>();
     ValueProviderFactories = new List<IValueProviderFactory>();
 }