Пример #1
0
 public virtual IQuery <T> Where(Expression <Func <T, bool> > predicate)
 {
     if (predicate != null)
     {
         string whereExpression = _expresionist.Visit(predicate);
         _wheres.Add(whereExpression);
     }
     return(this);
 }
Пример #2
0
        /// <summary>
        /// Adds a where clause to the query
        /// </summary>
        /// <param name="predicate"></param>
        /// <returns>This instance so calls to this method are chainable</returns>
        public virtual IQuery <T> Where(Expression <Func <T, bool> > predicate)
        {
            if (predicate != null)
            {
                var    expressionHelper = new ModelToSqlExpressionHelper <T>();
                string whereExpression  = expressionHelper.Visit(predicate);

                _wheres.Add(new Tuple <string, object[]>(whereExpression, expressionHelper.GetSqlParameters()));
            }
            return(this);
        }