/// <summary> /// Add a filter for a field/property with the string type. /// Configures Equals, NotEqual, Contains, StartsWith and EndsWith filters /// with Contains being the default. /// </summary> /// <param name="property">The field/property name.</param> /// <returns> /// Itself. An instance of <see cref="FilterExpressionProviderDictionary{TEntity}"/>. /// </returns> public FilterExpressionProviderDictionary <TEntity> AddStringFilter(string property) { var expressionProvider = new StringFilterExpressionProvider <TEntity>(property); this.Add(property, expressionProvider); return(this); }
/// <summary> /// Add a filter for a field/property with the string type. /// Provide a factory function receiving the filter value for this field/property and /// returning a dictionary of supported filter types with appropriate implementation. /// </summary> /// <param name="property">The field/property name.</param> /// <param name="builder">The filter factory.</param> /// <returns> /// Itself. An instance of <see cref="FilterExpressionProviderDictionary{TEntity}"/>. /// </returns> public FilterExpressionProviderDictionary <TEntity> AddFilter( string property, Func <string, IDictionary <FilterType, Expression <Func <TEntity, bool> > > > builder) { var expressionProvider = new StringFilterExpressionProvider <TEntity>(builder); this.Add(property, expressionProvider); return(this); }