Esempio n. 1
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);
        }