/// <summary> /// Filters the entity types that this convention applies to based on a /// predicate. /// </summary> /// <param name="predicate"> A function to test each entity type for a condition. </param> /// <returns> /// An <see cref="TypeConventionConfiguration{T}" /> instance so that multiple calls can be chained. /// </returns> public TypeConventionConfiguration <T> Where(Func <Type, bool> predicate) { Check.NotNull(predicate, "predicate"); return(new TypeConventionConfiguration <T>( _conventionsConfiguration, IEnumerableExtensions.Append(_predicates, predicate))); }
/// <summary> /// Filters the entity types that this convention applies to based on a /// predicate. /// </summary> /// <param name="predicate"> A function to test each entity type for a condition. </param> /// <returns> /// An <see cref="TypeConventionConfiguration" /> instance so that multiple calls can be chained. /// </returns> public TypeConventionConfiguration Where(Func <Type, bool> predicate) { Check.NotNull(predicate, "predicate"); #if NETSTANDARD return(new TypeConventionConfiguration(_conventionsConfiguration, IEnumerableExtensions.Append(_predicates, predicate))); #else return(new TypeConventionConfiguration(_conventionsConfiguration, _predicates.Append(predicate))); #endif }
/// <summary> /// Filters the properties that this convention applies to based on a predicate. /// </summary> /// <param name="predicate"> A function to test each property for a condition. </param> /// <returns> /// A <see cref="PropertyConventionConfiguration" /> instance so that multiple calls can be chained. /// </returns> public PropertyConventionConfiguration Where(Func <PropertyInfo, bool> predicate) { Check.NotNull(predicate, "predicate"); return(new PropertyConventionConfiguration(_conventionsConfiguration, IEnumerableExtensions.Append(_predicates, predicate))); }