Пример #1
0
 private static void LikeLeft(MethodCallExpression expression, SqlPack sqlPack)
 {
     if (expression.Object != null)
     {
         Expression2SqlProvider.Where(expression.Object, sqlPack);
     }
     Expression2SqlProvider.Where(expression.Arguments[0], sqlPack);
     sqlPack += " like '%' +";
     Expression2SqlProvider.Where(expression.Arguments[1], sqlPack);
 }
Пример #2
0
        protected override SqlPack Where(BinaryExpression expression, SqlPack sqlPack)
        {
            Expression2SqlProvider.Where(expression.Left, sqlPack);
            int signIndex = sqlPack.Length;

            Expression2SqlProvider.Where(expression.Right, sqlPack);
            int sqlLength = sqlPack.Length;

            if (sqlLength - signIndex == 5 && sqlPack.ToString().EndsWith("null"))
            {
                OperatorParser(expression.NodeType, signIndex, sqlPack, true);
            }
            else
            {
                OperatorParser(expression.NodeType, signIndex, sqlPack);
            }

            return(sqlPack);
        }
Пример #3
0
 protected override SqlPack Where(UnaryExpression expression, SqlPack sqlPack)
 {
     Expression2SqlProvider.Where(expression.Operand, sqlPack);
     return(sqlPack);
 }
Пример #4
0
 private static void In(MethodCallExpression expression, SqlPack sqlPack)
 {
     Expression2SqlProvider.Where(expression.Arguments[0], sqlPack);
     sqlPack += " in";
     Expression2SqlProvider.In(expression.Arguments[1], sqlPack);
 }
Пример #5
0
 public Expression2SqlCore <T> Where(Expression <Func <T, bool> > expression)
 {
     this._sqlPack += "\nwhere";
     Expression2SqlProvider.Where(expression.Body, this._sqlPack);
     return(this);
 }