/// <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)); }
/// <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); }