Exemplo n.º 1
0
        /// <summary>
        /// Applies filters to the given where clause and joins them together in OR logic.
        /// </summary>
        /// <param name="where"></param>
        /// <param name="whereClause"></param>
        /// <returns></returns>
        public static IDbQueryWhereClause Any(this Csg.Data.IDbQueryWhereClause where, Action <IDbQueryWhereClause> whereClause)
        {
            var orWhere = new Csg.Data.DbQueryWhereClause(where.Root, SqlLogic.Or);

            whereClause(orWhere);
            where.AddFilter(orWhere.Filters);

            return(where);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Adds the given filter to a query builder where clause.
 /// </summary>
 /// <param name="where"></param>
 /// <param name="filter"></param>
 /// <param name="valueType"></param>
 /// <param name="valueTypeSize"></param>
 /// <param name="stringMatchType"></param>
 /// <param name="performDataTypeConversion"></param>
 /// <param name="valueConverter"></param>
 /// <returns></returns>
 public static IDbQueryWhereClause AddFilter(this Csg.Data.IDbQueryWhereClause where, ListFilter filter, System.Data.DbType valueType, int?valueTypeSize = null, SqlWildcardDecoration stringMatchType = SqlWildcardDecoration.BeginsWith, bool performDataTypeConversion = true, Func <object, object> valueConverter = null)
 {
     Csg.ListQuery.Sql.Internal.Extensions.AddFilter(where, filter.Name, filter.Operator ?? ListFilterOperator.Equal, filter.Value, valueType: valueType, valueTypeSize: valueTypeSize, stringMatchType: stringMatchType, performDataTypeConversion: performDataTypeConversion, valueConverter: valueConverter);
     return(where);
 }