Efficient pagination using OFFSET-FETCH on SQL Server.
| ID | Name | Category | Price | Stock | Rating | Reviews | SKU |
|---|---|---|---|---|---|---|---|
| 4388 | Mega Sports & Outdoors Product 2024 | Sports & Outdoors | $89.64 | 300 | ★ 3.2 | 464 | SKU-004388 |
| 4389 | Elite Automotive Product 2024 | Automotive | $519.37 | 411 | ★ 3.3 | 197 | SKU-004389 |
| 4391 | Pro Health & Beauty Product Pro | Health & Beauty | $126.22 | 230 | ★ 4.3 | 607 | SKU-004391 |
| 4392 | Elite Sports & Outdoors Product Pro | Sports & Outdoors | $426.60 | 70 | ★ 3.6 | 293 | SKU-004392 |
| 4393 | Standard Sports & Outdoors Product Advanced | Sports & Outdoors | $831.76 | 142 | ★ 3.8 | 281 | SKU-004393 |
| 4394 | Standard Electronics Product Special Edition | Electronics | $596.57 | 118 | ★ 3.6 | 769 | SKU-004394 |
| 4397 | Pro Home & Garden Product Special Edition | Home & Garden | $415.76 | 420 | ★ 2.5 | 692 | SKU-004397 |
| 4398 | Elite Electronics Product Special Edition | Electronics | $162.02 | 436 | ★ 2.7 | 900 | SKU-004398 |
| 4399 | Mega Health & Beauty Product Max | Health & Beauty | $477.82 | 149 | ★ 1.4 | 878 | SKU-004399 |
| 4400 | Ultra Clothing Product Plus | Clothing | $650.96 | 90 | ★ 1.8 | 476 | SKU-004400 |
| 4401 | Deluxe Electronics Product Pro | Electronics | $963.03 | 62 | ★ 1.7 | 237 | SKU-004401 |
| 4402 | Economy Food & Grocery Product 2024 | Food & Grocery | $105.70 | 82 | ★ 2.6 | 79 | SKU-004402 |
| 4403 | Super Automotive Product Lite | Automotive | $838.39 | 274 | ★ 3.2 | 238 | SKU-004403 |
| 4404 | Professional Office Supplies Product XL | Office Supplies | $803.61 | 243 | ★ 3.2 | 681 | SKU-004404 |
| 4406 | Premium Office Supplies Product Max | Office Supplies | $670.79 | 58 | ★ 4.6 | 659 | SKU-004406 |
| 4407 | Standard Automotive Product Mini | Automotive | $567.68 | 149 | ★ 3.0 | 220 | SKU-004407 |
| 4408 | Super Office Supplies Product Lite | Office Supplies | $373.82 | 416 | ★ 1.5 | 828 | SKU-004408 |
| 4409 | Mega Office Supplies Product Lite | Office Supplies | $215.56 | 204 | ★ 4.7 | 406 | SKU-004409 |
| 4410 | Super Office Supplies Product Mini | Office Supplies | $613.86 | 186 | ★ 4.9 | 133 | SKU-004410 |
| 4411 | Professional Health & Beauty Product Pro | Health & Beauty | $690.41 | 173 | ★ 4.7 | 988 | SKU-004411 |
| 4412 | Premium Books Product Special Edition | Books | $381.45 | 190 | ★ 3.1 | 513 | SKU-004412 |
| 4413 | Elite Sports & Outdoors Product Advanced | Sports & Outdoors | $638.70 | 407 | ★ 3.8 | 569 | SKU-004413 |
| 4414 | Ultra Automotive Product Max | Automotive | $441.43 | 80 | ★ 3.1 | 609 | SKU-004414 |
| 4415 | Deluxe Health & Beauty Product Classic | Health & Beauty | $492.36 | 464 | ★ 4.5 | 397 | SKU-004415 |
| 4417 | Deluxe Office Supplies Product Mini | Office Supplies | $742.49 | 358 | ★ 3.0 | 621 | SKU-004417 |
| 4419 | Deluxe Books Product Classic | Books | $173.21 | 176 | ★ 4.4 | 366 | SKU-004419 |
| 4420 | Super Sports & Outdoors Product Pro | Sports & Outdoors | $888.68 | 5 | ★ 1.3 | 537 | SKU-004420 |
| 4421 | Pro Books Product Plus | Books | $135.42 | 26 | ★ 4.1 | 119 | SKU-004421 |
| 4422 | Professional Automotive Product Lite | Automotive | $975.62 | 378 | ★ 1.1 | 187 | SKU-004422 |
| 4423 | Deluxe Health & Beauty Product Lite | Health & Beauty | $734.10 | 33 | ★ 1.5 | 61 | SKU-004423 |
| 4424 | Super Sports & Outdoors Product Advanced | Sports & Outdoors | $843.79 | 84 | ★ 2.7 | 33 | SKU-004424 |
| 4425 | Super Home & Garden Product Classic | Home & Garden | $893.40 | 178 | ★ 4.1 | 226 | SKU-004425 |
| 4426 | Super Health & Beauty Product Plus | Health & Beauty | $715.83 | 159 | ★ 2.6 | 932 | SKU-004426 |
| 4428 | Elite Health & Beauty Product Special Edition | Health & Beauty | $846.61 | 417 | ★ 4.8 | 164 | SKU-004428 |
| 4429 | Ultra Office Supplies Product Classic | Office Supplies | $795.86 | 44 | ★ 3.3 | 197 | SKU-004429 |
| 4430 | Elite Home & Garden Product Special Edition | Home & Garden | $188.39 | 404 | ★ 3.4 | 48 | SKU-004430 |
| 4431 | Pro Sports & Outdoors Product Mini | Sports & Outdoors | $375.18 | 183 | ★ 3.0 | 265 | SKU-004431 |
| 4432 | Mega Home & Garden Product Mini | Home & Garden | $246.10 | 281 | ★ 4.7 | 479 | SKU-004432 |
| 4433 | Deluxe Food & Grocery Product Max | Food & Grocery | $21.62 | 15 | ★ 1.1 | 109 | SKU-004433 |
| 4436 | Super Books Product Advanced | Books | $993.33 | 180 | ★ 1.8 | 533 | SKU-004436 |
| 4437 | Premium Office Supplies Product Pro | Office Supplies | $900.06 | 302 | ★ 2.1 | 350 | SKU-004437 |
| 4438 | Pro Clothing Product Pro | Clothing | $889.59 | 135 | ★ 4.9 | 649 | SKU-004438 |
| 4439 | Deluxe Food & Grocery Product 2024 | Food & Grocery | $586.59 | 380 | ★ 1.8 | 76 | SKU-004439 |
| 4441 | Professional Clothing Product Advanced | Clothing | $159.81 | 58 | ★ 3.7 | 456 | SKU-004441 |
| 4442 | Mega Home & Garden Product XL | Home & Garden | $465.50 | 299 | ★ 2.5 | 984 | SKU-004442 |
| 4443 | Pro Health & Beauty Product Lite | Health & Beauty | $419.16 | 303 | ★ 1.5 | 774 | SKU-004443 |
| 4444 | Pro Home & Garden Product Lite | Home & Garden | $865.19 | 150 | ★ 4.2 | 722 | SKU-004444 |
| 4445 | Standard Sports & Outdoors Product 2024 | Sports & Outdoors | $801.83 | 478 | ★ 2.6 | 884 | SKU-004445 |
| 4446 | Premium Electronics Product Advanced | Electronics | $516.26 | 173 | ★ 1.2 | 626 | SKU-004446 |
| 4447 | Elite Food & Grocery Product Classic | Food & Grocery | $543.07 | 385 | ★ 3.1 | 594 | SKU-004447 |
| 4448 | Standard Office Supplies Product 2024 | Office Supplies | $303.87 | 299 | ★ 3.1 | 916 | SKU-004448 |
| 4449 | Ultra Home & Garden Product Classic | Home & Garden | $857.23 | 273 | ★ 3.3 | 493 | SKU-004449 |
| 4450 | Premium Office Supplies Product Advanced | Office Supplies | $820.60 | 455 | ★ 4.4 | 597 | SKU-004450 |
| 4454 | Standard Sports & Outdoors Product Advanced | Sports & Outdoors | $281.68 | 230 | ★ 3.7 | 118 | SKU-004454 |
| 4455 | Pro Sports & Outdoors Product Pro | Sports & Outdoors | $196.57 | 382 | ★ 1.3 | 584 | SKU-004455 |
| 4456 | Economy Home & Garden Product 2024 | Home & Garden | $377.41 | 446 | ★ 4.6 | 885 | SKU-004456 |
| 4458 | Super Books Product Max | Books | $248.32 | 91 | ★ 4.4 | 90 | SKU-004458 |
| 4459 | Super Health & Beauty Product Classic | Health & Beauty | $202.51 | 129 | ★ 3.9 | 628 | SKU-004459 |
| 4460 | Super Food & Grocery Product XL | Food & Grocery | $920.72 | 124 | ★ 2.5 | 44 | SKU-004460 |
| 4461 | Premium Electronics Product Classic | Electronics | $373.89 | 478 | ★ 3.2 | 417 | SKU-004461 |
| 4462 | Elite Health & Beauty Product Pro | Health & Beauty | $895.20 | 498 | ★ 3.7 | 926 | SKU-004462 |
| 4464 | Deluxe Automotive Product Max | Automotive | $154.52 | 373 | ★ 1.8 | 183 | SKU-004464 |
| 4465 | Pro Home & Garden Product Classic | Home & Garden | $389.73 | 492 | ★ 1.2 | 549 | SKU-004465 |
| 4466 | Deluxe Office Supplies Product Lite | Office Supplies | $938.86 | 101 | ★ 4.5 | 375 | SKU-004466 |
| 4467 | Standard Books Product Pro | Books | $409.32 | 9 | ★ 4.8 | 262 | SKU-004467 |
| 4468 | Mega Office Supplies Product Special Edition | Office Supplies | $934.75 | 438 | ★ 1.4 | 55 | SKU-004468 |
| 4469 | Standard Toys & Games Product Pro | Toys & Games | $985.46 | 0 | ★ 1.7 | 305 | SKU-004469 |
| 4470 | Standard Electronics Product Advanced | Electronics | $837.73 | 49 | ★ 4.1 | 695 | SKU-004470 |
| 4471 | Deluxe Books Product Mini | Books | $573.18 | 135 | ★ 4.5 | 372 | SKU-004471 |
| 4472 | Standard Sports & Outdoors Product Mini | Sports & Outdoors | $878.70 | 291 | ★ 1.4 | 635 | SKU-004472 |
| 4473 | Deluxe Books Product Special Edition | Books | $949.59 | 178 | ★ 3.4 | 300 | SKU-004473 |
| 4474 | Mega Electronics Product XL | Electronics | $900.75 | 224 | ★ 2.8 | 946 | SKU-004474 |
| 4475 | Mega Clothing Product Advanced | Clothing | $744.30 | 451 | ★ 3.9 | 752 | SKU-004475 |
| 4477 | Pro Sports & Outdoors Product Special Edition | Sports & Outdoors | $485.92 | 131 | ★ 3.4 | 848 | SKU-004477 |
| 4478 | Mega Toys & Games Product Mini | Toys & Games | $26.84 | 290 | ★ 3.9 | 810 | SKU-004478 |
| 4479 | Economy Office Supplies Product Lite | Office Supplies | $229.36 | 205 | ★ 1.8 | 437 | SKU-004479 |
| 4480 | Ultra Sports & Outdoors Product Special Edition | Sports & Outdoors | $137.23 | 465 | ★ 4.1 | 665 | SKU-004480 |
| 4481 | Super Office Supplies Product Max | Office Supplies | $873.99 | 59 | ★ 2.4 | 572 | SKU-004481 |
| 4482 | Ultra Home & Garden Product Special Edition | Home & Garden | $678.50 | 346 | ★ 3.7 | 820 | SKU-004482 |
| 4483 | Standard Home & Garden Product Mini | Home & Garden | $864.44 | 224 | ★ 1.6 | 161 | SKU-004483 |
| 4485 | Premium Electronics Product Special Edition | Electronics | $509.07 | 263 | ★ 1.2 | 727 | SKU-004485 |
| 4486 | Deluxe Books Product 2024 | Books | $194.97 | 497 | ★ 3.8 | 996 | SKU-004486 |
| 4487 | Super Automotive Product Mini | Automotive | $57.26 | 494 | ★ 2.1 | 316 | SKU-004487 |
| 4488 | Deluxe Automotive Product Mini | Automotive | $191.47 | 489 | ★ 3.8 | 913 | SKU-004488 |
| 4489 | Deluxe Health & Beauty Product Pro | Health & Beauty | $144.37 | 273 | ★ 2.5 | 126 | SKU-004489 |
| 4490 | Ultra Office Supplies Product Plus | Office Supplies | $109.68 | 85 | ★ 3.4 | 755 | SKU-004490 |
| 4491 | Ultra Clothing Product Max | Clothing | $975.26 | 177 | ★ 2.5 | 172 | SKU-004491 |
| 4492 | Ultra Electronics Product Plus | Electronics | $411.13 | 103 | ★ 1.9 | 266 | SKU-004492 |
| 4493 | Deluxe Electronics Product Lite | Electronics | $134.55 | 99 | ★ 4.6 | 83 | SKU-004493 |
| 4494 | Super Books Product Advanced | Books | $552.13 | 274 | ★ 1.9 | 298 | SKU-004494 |
| 4495 | Standard Automotive Product Classic | Automotive | $70.81 | 1 | ★ 1.5 | 883 | SKU-004495 |
| 4496 | Premium Toys & Games Product Pro | Toys & Games | $961.19 | 121 | ★ 3.5 | 756 | SKU-004496 |
| 4497 | Premium Sports & Outdoors Product Pro | Sports & Outdoors | $79.89 | 182 | ★ 4.2 | 385 | SKU-004497 |
| 4498 | Deluxe Sports & Outdoors Product 2024 | Sports & Outdoors | $88.07 | 389 | ★ 2.7 | 306 | SKU-004498 |
| 4499 | Elite Clothing Product XL | Clothing | $751.87 | 471 | ★ 4.1 | 508 | SKU-004499 |
| 4500 | Professional Clothing Product Plus | Clothing | $353.06 | 363 | ★ 3.1 | 566 | SKU-004500 |
| 4501 | Ultra Food & Grocery Product Plus | Food & Grocery | $451.54 | 406 | ★ 4.9 | 891 | SKU-004501 |
| 4503 | Deluxe Sports & Outdoors Product Max | Sports & Outdoors | $428.66 | 378 | ★ 2.8 | 706 | SKU-004503 |
| 4504 | Professional Office Supplies Product Mini | Office Supplies | $634.73 | 266 | ★ 3.9 | 223 | SKU-004504 |
| 4505 | Super Electronics Product Advanced | Electronics | $981.49 | 327 | ★ 3.6 | 640 | SKU-004505 |
// Efficient pagination with Skip and Take
public async Task<PaginatedResult<DemoProduct>> GetPaginatedProductsAsync(int page, int pageSize)
{
// Get total count (cached if possible)
var totalCount = await _context.DemoProducts.CountAsync(p => p.IsActive);
// Get page of results
var items = await _context.DemoProducts
.Where(p => p.IsActive)
.OrderBy(p => p.Id) // Important: Must have ORDER BY for consistent paging
.Skip((page - 1) * pageSize) // OFFSET in SQL
.Take(pageSize) // FETCH NEXT in SQL
.AsNoTracking() // No tracking needed for read-only
.ToListAsync();
return new PaginatedResult<DemoProduct>
{
Items = items,
TotalCount = totalCount,
Page = page,
PageSize = pageSize
};
}