using System.Linq.Expressions; namespace SqlSugar { public class SubTop : ISubOperation { public ExpressionContext Context { get; set; } public Expression Expression { get; set; } public string Name { get { return "Top"; } } public int Sort { get { if (this.Context is SqlServerExpressionContext) { return 150; } else { return 490; } } } public string GetValue(Expression expression) { if (this.Context is SqlServerExpressionContext) { return "TOP 1"; } else if (this.Context is OracleExpressionContext) { return "ROWNUM=1"; } else { return "limit 0,1"; } } } }