コード例 #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);
            var signIndex = sqlPack.Length;

            Expression2SqlProvider.Where(expression.Right, sqlPack);
            var 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 new static void In(MethodCallExpression expression, SqlPack sqlPack)
 {
     Expression2SqlProvider.Where(expression.Arguments[0], sqlPack);
     sqlPack += " in";
     Expression2SqlProvider.In(expression.Arguments[1], sqlPack);
 }