예제 #1
0
        public static ValueColumnFilter <TSourceData, TFilteringKey> Create(PropertyInfo columnProp, IConfigurator conf, Func <IQueryable <TSourceData>, TFilteringKey, IQueryable <TSourceData> > filterDelegate)
        {
            columnProp = conf.CheckTableColum(columnProp);
            var instance = new ValueColumnFilter <TSourceData, TFilteringKey>(columnProp.Name, conf, filterDelegate);

            return(instance);
        }
예제 #2
0
        public static ValueColumnFilter <TSourceData, TFilteringKey> Create <TSourceColumn>(PropertyInfo columnProp, IConfigurator conf,
                                                                                            Expression <Func <TSourceData, TSourceColumn> > column)
        {
            columnProp = conf.CheckTableColum(columnProp);
            var ex       = column;// LambdaHelpers.FixNullableColumn(column);
            var instance = new ValueColumnFilter <TSourceData, TFilteringKey>(columnProp.Name, conf, ex);

            return(instance);
        }
예제 #3
0
        /// <summary>
        /// Attaches simple value filter to column.
        /// Value column filter supports specifying only one value.
        /// This filter filters out source query leaving records that are having value denoted by column that is equal to specified value in filter.
        /// </summary>
        /// <param name="column">Column</param>
        /// <param name="filterDelegate">Matching source column to be filtered</param>
        /// <returns></returns>
        public static ValueColumnFilter <TSourceData, TTableColumn> FilterValueNoUiBy <TSourceData, TTableData, TTableColumn>(
            this ColumnUsage <TSourceData, TTableData, TTableColumn> column,
            Func <IQueryable <TSourceData>, TTableColumn, IQueryable <TSourceData> > filterDelegate
            ) where TTableData : new()
        {
            var filter = ValueColumnFilter <TSourceData, TTableColumn> .Create(column.ColumnProperty, column.Configurator, filterDelegate);

            column.Configurator.RegisterFilter(filter);
            return(filter);
        }
예제 #4
0
        /// <summary>
        /// Attaches simple value filter to column.
        /// Value column filter supports specifying only one value.
        /// This filter filters out source query leaving records that are having value denoted by column that is equal to specified value in filter.
        /// </summary>
        /// <param name="column">Column</param>
        /// <param name="sourceColumn">Matching source column to be filtered</param>
        /// <returns></returns>
        public static ValueColumnFilter <TSourceData, TSourceColumn> FilterValueNoUi <TSourceData, TTableData, TTableColumn, TSourceColumn>(
            this ColumnUsage <TSourceData, TTableData, TTableColumn> column,
            Expression <Func <TSourceData, TSourceColumn> > sourceColumn
            ) where TTableData : new()
        {
            var filter = ValueColumnFilter <TSourceData, TSourceColumn> .Create(column.ColumnProperty, column.Configurator, sourceColumn);

            column.Configurator.RegisterFilter(filter);
            return(filter);
        }