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