protected override SqlCaluse Select(NewExpression exp, SqlCaluse sqlCaluse) { for (int i = 0; i < exp.Arguments.Count; i++) { var argExp = exp.Arguments[i]; if (sqlCaluse.GetMemberName == null) { sqlCaluse.GetMemberName = () => { return(exp.Members[i].Name); } } ; ExpressionVisit.Select(argExp, sqlCaluse); } return(sqlCaluse); }
public virtual void ToInfo() { Queue.Sql = new StringBuilder(); var strSelectSql = Visit.Select(Queue.ExpSelect); var strWhereSql = Visit.Where(Queue.ExpWhere); var strOrderBySql = Visit.OrderBy(Queue.ExpOrderBy); if (string.IsNullOrWhiteSpace(strSelectSql)) { strSelectSql = "*"; } if (!string.IsNullOrWhiteSpace(strWhereSql)) { strWhereSql = "WHERE " + strWhereSql; } if (!string.IsNullOrWhiteSpace(strOrderBySql)) { strOrderBySql = "ORDER BY " + strOrderBySql; } Queue.Sql.AppendFormat("SELECT {0} FROM {1} {2} {3} rownum <=1", strSelectSql, Query.DbProvider.KeywordAegis(TableName), strWhereSql, strOrderBySql); }
public virtual Queue ToEntity() { Queue.Sql = new StringBuilder(); var strSelectSql = Visit.Select(Queue.ExpSelect); var strWhereSql = Visit.Where(Queue.ExpWhere); var strOrderBySql = Visit.OrderBy(Queue.ExpOrderBy); if (string.IsNullOrWhiteSpace(strSelectSql)) { strSelectSql = "*"; } if (!string.IsNullOrWhiteSpace(strWhereSql)) { strWhereSql = "WHERE " + strWhereSql; } if (!string.IsNullOrWhiteSpace(strOrderBySql)) { strOrderBySql = "ORDER BY " + strOrderBySql; } Queue.Sql.AppendFormat("SELECT TOP 1 {0} FROM {1} {2} {3}", strSelectSql, QueueManger.DbProvider.KeywordAegis(Queue.Name), strWhereSql, strOrderBySql); return(Queue); }
protected override SqlCaluse Select(UnaryExpression exp, SqlCaluse sqlCaluse) { ExpressionVisit.Select(exp.Operand, sqlCaluse); return(sqlCaluse); }