File tree Expand file tree Collapse file tree
DevExtreme.AspNet.Data.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,12 +93,25 @@ public void ActiveForFirstPage() {
9393 Assert . Contains ( ".Select(obj => new AnonType`1" , loadOptions . ExpressionLog [ 0 ] ) ;
9494 }
9595
96+ [ Fact ]
97+ public void DisabledWithoutTake ( ) {
98+ var loadOptions = new SampleLoadOptions {
99+ SuppressGuardNulls = true ,
100+ PaginateViaPrimaryKey = true
101+ } ;
102+
103+ DataSourceLoader . Load ( new object [ 0 ] , loadOptions ) ;
104+
105+ Assert . NotEmpty ( loadOptions . ExpressionLog ) ;
106+ Assert . DoesNotContain ( loadOptions . ExpressionLog , line => line . Contains ( ".Select" ) ) ;
107+ }
108+
96109 [ Fact ]
97110 public void RequiresPrimaryKey ( ) {
98111 var error = Record . Exception ( delegate {
99112 DataSourceLoader . Load ( new string [ 0 ] , new SampleLoadOptions {
100113 PaginateViaPrimaryKey = true ,
101- Skip = 1
114+ Take = 1
102115 } ) ;
103116 } ) ;
104117 Assert . True ( error is InvalidOperationException ) ;
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ public LoadResult Load() {
6666
6767 Expression loadExpr ;
6868
69- if ( ! deferPaging && Context . PaginateViaPrimaryKey ) {
69+ if ( ! deferPaging && Context . PaginateViaPrimaryKey && Context . Take > 0 ) {
7070 if ( ! Context . HasPrimaryKey ) {
7171 throw new InvalidOperationException ( nameof ( DataSourceLoadOptionsBase . PaginateViaPrimaryKey )
7272 + " requires a primary key."
You can’t perform that action at this time.
0 commit comments