public static RangeColumnFilter <TSourceData, TVal> Create(PropertyInfo columnProp, IConfigurator conf, Func <IQueryable <TSourceData>, RangeTuple <TVal>, IQueryable <TSourceData> > filterDelegate) { columnProp = conf.CheckTableColum(columnProp); var instance = new RangeColumnFilter <TSourceData, TVal>(columnProp.Name, conf, filterDelegate); return(instance); }
/// <summary> /// Attaches Range filter to specified column without UI /// Range column filter supports 2 values (min. and max.) to be specified. /// This filter filters out source query leaving records that are having value denoted by column that is in specified range (between min. and max.) /// </summary> /// <param name="column">Column</param> /// <param name="filterDelegate">Filtering delegate</param> /// <returns>Fluent</returns> public static RangeColumnFilter <TSourceData, TTableColumn> FilterRangeNoUiBy <TSourceData, TTableData, TTableColumn>( this ColumnUsage <TSourceData, TTableData, TTableColumn> column, Func <IQueryable <TSourceData>, RangeTuple <TTableColumn>, IQueryable <TSourceData> > filterDelegate) where TTableData : new() { var filter = RangeColumnFilter <TSourceData, TTableColumn> .Create(column.ColumnProperty, column.Configurator, filterDelegate); column.Configurator.RegisterFilter(filter); return(filter); }
public static RangeColumnFilter <TSourceData, TVal> Create <TSourceColumn>(PropertyInfo columnProp, IConfigurator conf, Expression <Func <TSourceData, TSourceColumn> > column) { columnProp = conf.CheckTableColum(columnProp); var ex = column; var instance = new RangeColumnFilter <TSourceData, TVal>(columnProp.Name, conf, ex); return(instance); }
/// <summary> /// Attaches Range filter to specified column. /// Range column filter supports 2 values (min. and max.) to be specified. /// This filter filters out source query leaving records that are having value denoted by column that is in specified range (between min. and max.) /// </summary> /// <param name="column">Column</param> /// <param name="sourceColumn">Matching source column to be filtered</param> /// <returns>Fluent</returns> public static RangeColumnFilter <TSourceData, TSourceColumn> FilterRangeNoUi <TSourceData, TTableData, TTableColumn, TSourceColumn>( this ColumnUsage <TSourceData, TTableData, TTableColumn> column, Expression <Func <TSourceData, TSourceColumn> > sourceColumn ) where TTableData : new() { var filter = RangeColumnFilter <TSourceData, TSourceColumn> .Create(column.ColumnProperty, column.Configurator, sourceColumn); column.Configurator.RegisterFilter(filter); return(filter); }
/// <summary> /// Forces server to treat equal date ranges as necessarity of selecting the whole day /// </summary> /// <typeparam name="TSourceData"></typeparam> /// <param name="f"></param> /// <param name="treat">When true, equal selected dates will be treated as whole day</param> /// <returns></returns> public static RangeColumnFilter <TSourceData, DateTime?> TreatEqualDateAsWholeDay <TSourceData>(this RangeColumnFilter <TSourceData, DateTime?> f, bool treat = true) { f.TreatEqualDateAsWholeDay = treat; return(f); }