protected override SqlGenerate Select(NewExpression expression, SqlGenerate sqlGenerate) { foreach (Expression item in expression.Arguments) { SqlExpressionProvider.Select(item, sqlGenerate); } return(sqlGenerate); }
/// <summary> /// 查询 /// </summary> /// <param name="expression"></param> /// <param name="orderBy">排序字段</param> /// <returns></returns> public SqlExpressionCore <T> Select(Expression <Func <T, object> > expression = null, string orderBy = "") { var sql = $"select {{0}}{Environment.NewLine}from {sqlGenerate.TableName}"; var fields = string.Empty; if (expression == null) { fields = "*"; } else { SqlExpressionProvider.Select(expression, sqlGenerate); fields = sqlGenerate.SelectFieldsStr; } sqlGenerate.Sql.AppendFormat(sql, fields); return(this); }
protected override SqlGenerate Select(UnaryExpression expression, SqlGenerate sqlGenerate) { SqlExpressionProvider.Select(expression.Operand, sqlGenerate); return(sqlGenerate); }
protected override SqlGenerate Select(LambdaExpression expression, SqlGenerate sqlGenerate) { SqlExpressionProvider.Select(expression.Body, sqlGenerate); return(sqlGenerate); }