File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ public static partial class SqlQuery
1414 public sealed class LimitClause < T > : ISqlQuery
1515 {
1616 private readonly OrderByClause < T > orderBy ;
17- private readonly Nullable < int > limit ;
17+ private readonly int limit ;
1818 private readonly Nullable < int > offset ;
1919
20- internal LimitClause ( OrderByClause < T > orderBy , Nullable < int > limit , Nullable < int > offset )
20+ internal LimitClause ( OrderByClause < T > orderBy , int limit , Nullable < int > offset )
2121 {
2222 this . orderBy = orderBy ;
2323 this . limit = limit ;
@@ -54,7 +54,7 @@ public override string ToString()
5454 {
5555 return
5656 orderBy . ToString ( ) +
57- ( limit . HasValue ? "\r \n LIMIT " + limit . Value : "" ) +
57+ "\r \n LIMIT " + limit +
5858 ( offset . HasValue ? "\r \n OFFSET " + offset . Value : "" ) ;
5959 }
6060 }
Original file line number Diff line number Diff line change @@ -68,7 +68,9 @@ public LimitClause<T> Take(int n)
6868 public LimitClause < T > Skip ( int n )
6969 {
7070 Contract . Requires ( n >= 0 ) ;
71- return new LimitClause < T > ( this , null , n ) ;
71+
72+ //If the LIMIT expression evaluates to a negative value, then there is no upper bound on the number of rows returned
73+ return new LimitClause < T > ( this , - 1 , n ) ;
7274 }
7375
7476 /// <summary>
You can’t perform that action at this time.
0 commit comments