Esempio n. 1
0
        /// <summary>
        /// Adds an <see cref="IExcludeTypeValidationFilter"/> that excludes the properties of
        /// the <see cref="Type"/> specified and its derived types from validaton.
        /// </summary>
        /// <param name="type"><see cref="Type"/> which should be excluded from validation.</param>
        public void Add(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            var typeBasedExcludeFilter = new DefaultTypeBasedExcludeFilter(type);

            Add(typeBasedExcludeFilter);
        }
Esempio n. 2
0
        /// <summary>
        /// Adds an <see cref="IExcludeTypeValidationFilter"/> that excludes the properties of
        /// the <see cref="Type"/> specified and its derived types from validaton.
        /// </summary>
        /// <param name="type"><see cref="Type"/> which should be excluded from validation.</param>
        public void Add([NotNull] Type type)
        {
            var typeBasedExcludeFilter = new DefaultTypeBasedExcludeFilter(type);

            Add(typeBasedExcludeFilter);
        }
 /// <summary>
 /// Adds a descriptor to the specified <paramref name="excludeTypeValidationFilters" /> that excludes the properties of 
 /// the <see cref="Type"/> specified and its derived types from validaton.
 /// </summary>
 /// <param name="excludeTypeValidationFilters">A list of <see cref="IExcludeTypeValidationFilter"/> which are used to
 /// get a collection of exclude filters to be applied for filtering model properties during validation.
 /// </param>
 /// <param name="type"><see cref="Type"/> which should be excluded from validation.</param>
 public static void Add(this IList<IExcludeTypeValidationFilter> excludeTypeValidationFilters, Type type)
 {
     var typeBasedExcludeFilter = new DefaultTypeBasedExcludeFilter(type);
     excludeTypeValidationFilters.Add(typeBasedExcludeFilter);
 }
 /// <summary>
 /// Adds a descriptor to the specified <paramref name="descriptorCollection" /> that excludes the properties of 
 /// the <see cref="Type"/> specified and its derived types from validaton.
 /// </summary>
 /// <param name="descriptorCollection">A list of <see cref="ExcludeValidationDescriptor"/> which are used to
 /// get a collection of exclude filters to be applied for filtering model properties during validation.
 /// </param>
 /// <param name="type"><see cref="Type"/> which should be excluded from validation.</param>
 public static void Add(this IList<ExcludeValidationDescriptor> descriptorCollection, Type type)
 {
     var typeBasedExcludeFilter = new DefaultTypeBasedExcludeFilter(type);
     descriptorCollection.Add(new ExcludeValidationDescriptor(typeBasedExcludeFilter));
 }