From 07f393c35b2be748e212b37667efc851012cffb2 Mon Sep 17 00:00:00 2001 From: Marcus Winding Quistgaard Date: Thu, 19 Mar 2026 19:21:53 +0100 Subject: [PATCH 1/3] Run linter with .net 10 sdk --- .../Controllers/PaginatedDataController.cs | 1 + src/Jameak.CursorPagination.SourceGenerator/DiagnosticHelper.cs | 1 + src/Jameak.CursorPagination.SourceGenerator/ExtensionMethods.cs | 1 + .../BaseExtractor.PaginationPropertyExtractionHelper.cs | 1 + .../Extractors/BaseExtractor.cs | 1 + .../Extractors/KeySetExtractor.cs | 1 + .../Extractors/OffsetExtractor.cs | 1 + src/Jameak.CursorPagination.SourceGenerator/HelperMethods.cs | 1 + .../KeySetPaginationClassBuilder.cs | 1 + .../OffsetPaginationClassBuilder.cs | 1 + src/Jameak.CursorPagination.SourceGenerator/PaginationKind.cs | 1 + .../Poco/BaseExtractedData.cs | 1 + .../Poco/ExtractedKeySetData.cs | 1 + .../Poco/ExtractedOffsetData.cs | 1 + src/Jameak.CursorPagination.SourceGenerator/TrackingNames.cs | 1 + src/Jameak.CursorPagination/InternalPaginatorHelper.cs | 1 + .../InputClasses/SimplePropertyPoco.cs | 1 + .../KeySetCursorSerializationTests.cs | 1 + .../KeySetPaginationTests.cs | 1 + .../OffsetCursorSerializationTests.cs | 1 + .../OffsetPaginationTests.cs | 1 + .../TestHelper.cs | 1 + test/Jameak.CursorPagination.SourceGenerator.Tests/ErrorTests.cs | 1 + .../FullNameOfDiagnosticAnalyzerTests.cs | 1 + .../GeneralTests.cs | 1 + .../InternalUsageAnalyzerTests.cs | 1 + .../KeySetSpecificTests.cs | 1 + .../ModuleInitializer.cs | 1 + .../NestedPropertyTests.cs | 1 + .../NullableTests.cs | 1 + .../OffsetSpecificTests.cs | 1 + test/Jameak.CursorPagination.Tests/AsyncDelegates.cs | 1 + test/Jameak.CursorPagination.Tests/DbClasses/DatabaseFixture.cs | 1 + test/Jameak.CursorPagination.Tests/DbClasses/TestDbContext.cs | 1 + .../InputClasses/NullablePropertyWithDbComputedColumnPoco.cs | 1 + .../InputClasses/PocoWithNestedProperty.cs | 1 + .../InputClasses/SimpleFieldPoco.cs | 1 + .../InputClasses/SimplePropertyPoco.cs | 1 + test/Jameak.CursorPagination.Tests/ModuleInitializer.cs | 1 + .../NullablePropertyTranslationTests.cs | 1 + test/Jameak.CursorPagination.Tests/OffsetPaginatorTests.cs | 1 + test/Jameak.CursorPagination.Tests/TestHelper.cs | 1 + 42 files changed, 42 insertions(+) diff --git a/samples/Jameak.CursorPagination.Sample/Controllers/PaginatedDataController.cs b/samples/Jameak.CursorPagination.Sample/Controllers/PaginatedDataController.cs index bba5e70..d5983e2 100644 --- a/samples/Jameak.CursorPagination.Sample/Controllers/PaginatedDataController.cs +++ b/samples/Jameak.CursorPagination.Sample/Controllers/PaginatedDataController.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Mvc; namespace Jameak.CursorPagination.Sample.Controllers; + [ApiController] [Route("api/[controller]/[action]")] public class PaginatedDataController : ControllerBase diff --git a/src/Jameak.CursorPagination.SourceGenerator/DiagnosticHelper.cs b/src/Jameak.CursorPagination.SourceGenerator/DiagnosticHelper.cs index 7ddfe09..88e70fa 100644 --- a/src/Jameak.CursorPagination.SourceGenerator/DiagnosticHelper.cs +++ b/src/Jameak.CursorPagination.SourceGenerator/DiagnosticHelper.cs @@ -5,6 +5,7 @@ #pragma warning disable RS2008 // Analyzer release tracking namespace Jameak.CursorPagination.SourceGenerator; + internal static class DiagnosticHelper { private const string UsageCategory = "Usage"; diff --git a/src/Jameak.CursorPagination.SourceGenerator/ExtensionMethods.cs b/src/Jameak.CursorPagination.SourceGenerator/ExtensionMethods.cs index c5fa13d..6588a00 100644 --- a/src/Jameak.CursorPagination.SourceGenerator/ExtensionMethods.cs +++ b/src/Jameak.CursorPagination.SourceGenerator/ExtensionMethods.cs @@ -5,6 +5,7 @@ using Microsoft.CodeAnalysis.Operations; namespace Jameak.CursorPagination.SourceGenerator; + internal static class ExtensionMethods { private static readonly SymbolDisplayFormat s_fullyQualifiedWithNullRefModifier = diff --git a/src/Jameak.CursorPagination.SourceGenerator/Extractors/BaseExtractor.PaginationPropertyExtractionHelper.cs b/src/Jameak.CursorPagination.SourceGenerator/Extractors/BaseExtractor.PaginationPropertyExtractionHelper.cs index cc2c6f0..c4c405f 100644 --- a/src/Jameak.CursorPagination.SourceGenerator/Extractors/BaseExtractor.PaginationPropertyExtractionHelper.cs +++ b/src/Jameak.CursorPagination.SourceGenerator/Extractors/BaseExtractor.PaginationPropertyExtractionHelper.cs @@ -7,6 +7,7 @@ using static Jameak.CursorPagination.SourceGenerator.HelperMethods; namespace Jameak.CursorPagination.SourceGenerator.Extractors; + internal abstract partial class BaseExtractor { private sealed class PaginationPropertyExtractionHelper diff --git a/src/Jameak.CursorPagination.SourceGenerator/Extractors/BaseExtractor.cs b/src/Jameak.CursorPagination.SourceGenerator/Extractors/BaseExtractor.cs index 3feceb5..d459775 100644 --- a/src/Jameak.CursorPagination.SourceGenerator/Extractors/BaseExtractor.cs +++ b/src/Jameak.CursorPagination.SourceGenerator/Extractors/BaseExtractor.cs @@ -3,6 +3,7 @@ using static Jameak.CursorPagination.SourceGenerator.HelperMethods; namespace Jameak.CursorPagination.SourceGenerator.Extractors; + internal abstract partial class BaseExtractor { internal abstract bool TryHandle(GeneratorAttributeSyntaxContext context, INamedTypeSymbol generatorClassSymbol, out BaseExtractedData? extractedData); diff --git a/src/Jameak.CursorPagination.SourceGenerator/Extractors/KeySetExtractor.cs b/src/Jameak.CursorPagination.SourceGenerator/Extractors/KeySetExtractor.cs index 7f309f3..412f07b 100644 --- a/src/Jameak.CursorPagination.SourceGenerator/Extractors/KeySetExtractor.cs +++ b/src/Jameak.CursorPagination.SourceGenerator/Extractors/KeySetExtractor.cs @@ -5,6 +5,7 @@ using static Jameak.CursorPagination.SourceGenerator.HelperMethods; namespace Jameak.CursorPagination.SourceGenerator.Extractors; + internal sealed class KeySetExtractor : BaseExtractor { internal override bool TryHandle(GeneratorAttributeSyntaxContext context, INamedTypeSymbol generatorClassSymbol, out BaseExtractedData? extractedData) diff --git a/src/Jameak.CursorPagination.SourceGenerator/Extractors/OffsetExtractor.cs b/src/Jameak.CursorPagination.SourceGenerator/Extractors/OffsetExtractor.cs index 1602707..aaf0c8b 100644 --- a/src/Jameak.CursorPagination.SourceGenerator/Extractors/OffsetExtractor.cs +++ b/src/Jameak.CursorPagination.SourceGenerator/Extractors/OffsetExtractor.cs @@ -4,6 +4,7 @@ using static Jameak.CursorPagination.SourceGenerator.HelperMethods; namespace Jameak.CursorPagination.SourceGenerator.Extractors; + internal sealed class OffsetExtractor : BaseExtractor { internal override bool TryHandle(GeneratorAttributeSyntaxContext context, INamedTypeSymbol generatorClassSymbol, out BaseExtractedData? extractedData) diff --git a/src/Jameak.CursorPagination.SourceGenerator/HelperMethods.cs b/src/Jameak.CursorPagination.SourceGenerator/HelperMethods.cs index 86f3084..1bde28b 100644 --- a/src/Jameak.CursorPagination.SourceGenerator/HelperMethods.cs +++ b/src/Jameak.CursorPagination.SourceGenerator/HelperMethods.cs @@ -10,6 +10,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; namespace Jameak.CursorPagination.SourceGenerator; + internal static class HelperMethods { diff --git a/src/Jameak.CursorPagination.SourceGenerator/KeySetPaginationClassBuilder.cs b/src/Jameak.CursorPagination.SourceGenerator/KeySetPaginationClassBuilder.cs index 88356b0..f38fa54 100644 --- a/src/Jameak.CursorPagination.SourceGenerator/KeySetPaginationClassBuilder.cs +++ b/src/Jameak.CursorPagination.SourceGenerator/KeySetPaginationClassBuilder.cs @@ -9,6 +9,7 @@ using static Jameak.CursorPagination.SourceGenerator.HelperMethods; namespace Jameak.CursorPagination.SourceGenerator; + internal static class KeySetPaginationClassBuilder { private const string PrivateHelperClassName = "PrivateHelper"; diff --git a/src/Jameak.CursorPagination.SourceGenerator/OffsetPaginationClassBuilder.cs b/src/Jameak.CursorPagination.SourceGenerator/OffsetPaginationClassBuilder.cs index b2a639c..a8a3b7b 100644 --- a/src/Jameak.CursorPagination.SourceGenerator/OffsetPaginationClassBuilder.cs +++ b/src/Jameak.CursorPagination.SourceGenerator/OffsetPaginationClassBuilder.cs @@ -6,6 +6,7 @@ using static Jameak.CursorPagination.SourceGenerator.HelperMethods; namespace Jameak.CursorPagination.SourceGenerator; + internal static class OffsetPaginationClassBuilder { private const string PrivateHelperClassName = "PrivateHelper"; diff --git a/src/Jameak.CursorPagination.SourceGenerator/PaginationKind.cs b/src/Jameak.CursorPagination.SourceGenerator/PaginationKind.cs index 8645b4a..816c1fa 100644 --- a/src/Jameak.CursorPagination.SourceGenerator/PaginationKind.cs +++ b/src/Jameak.CursorPagination.SourceGenerator/PaginationKind.cs @@ -1,4 +1,5 @@ namespace Jameak.CursorPagination.SourceGenerator; + internal enum PaginationKind { KeySet, diff --git a/src/Jameak.CursorPagination.SourceGenerator/Poco/BaseExtractedData.cs b/src/Jameak.CursorPagination.SourceGenerator/Poco/BaseExtractedData.cs index 81cb098..4bc7269 100644 --- a/src/Jameak.CursorPagination.SourceGenerator/Poco/BaseExtractedData.cs +++ b/src/Jameak.CursorPagination.SourceGenerator/Poco/BaseExtractedData.cs @@ -2,6 +2,7 @@ using Jameak.CursorPagination.SourceGenerator.Helpers; namespace Jameak.CursorPagination.SourceGenerator.Poco; + internal record BaseExtractedData { public string Name { get; } diff --git a/src/Jameak.CursorPagination.SourceGenerator/Poco/ExtractedKeySetData.cs b/src/Jameak.CursorPagination.SourceGenerator/Poco/ExtractedKeySetData.cs index 61d1f99..d8f4405 100644 --- a/src/Jameak.CursorPagination.SourceGenerator/Poco/ExtractedKeySetData.cs +++ b/src/Jameak.CursorPagination.SourceGenerator/Poco/ExtractedKeySetData.cs @@ -3,6 +3,7 @@ using Jameak.CursorPagination.SourceGenerator.Helpers; namespace Jameak.CursorPagination.SourceGenerator.Poco; + internal record ExtractedKeySetData : BaseExtractedData { public string? Namespace { get; } diff --git a/src/Jameak.CursorPagination.SourceGenerator/Poco/ExtractedOffsetData.cs b/src/Jameak.CursorPagination.SourceGenerator/Poco/ExtractedOffsetData.cs index ec85ca2..6676d60 100644 --- a/src/Jameak.CursorPagination.SourceGenerator/Poco/ExtractedOffsetData.cs +++ b/src/Jameak.CursorPagination.SourceGenerator/Poco/ExtractedOffsetData.cs @@ -2,6 +2,7 @@ using Jameak.CursorPagination.SourceGenerator.Helpers; namespace Jameak.CursorPagination.SourceGenerator.Poco; + internal record ExtractedOffsetData : BaseExtractedData { public string? Namespace { get; } diff --git a/src/Jameak.CursorPagination.SourceGenerator/TrackingNames.cs b/src/Jameak.CursorPagination.SourceGenerator/TrackingNames.cs index 6175334..56494c6 100644 --- a/src/Jameak.CursorPagination.SourceGenerator/TrackingNames.cs +++ b/src/Jameak.CursorPagination.SourceGenerator/TrackingNames.cs @@ -1,4 +1,5 @@ namespace Jameak.CursorPagination.SourceGenerator; + internal static class TrackingNames { public const string InitialOffsetExtraction = nameof(InitialOffsetExtraction); diff --git a/src/Jameak.CursorPagination/InternalPaginatorHelper.cs b/src/Jameak.CursorPagination/InternalPaginatorHelper.cs index 4137089..e6cf1ad 100644 --- a/src/Jameak.CursorPagination/InternalPaginatorHelper.cs +++ b/src/Jameak.CursorPagination/InternalPaginatorHelper.cs @@ -5,6 +5,7 @@ using Jameak.CursorPagination.Page; namespace Jameak.CursorPagination; + internal static class InternalPaginatorHelper { internal sealed record EmptyNextPageState( diff --git a/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/InputClasses/SimplePropertyPoco.cs b/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/InputClasses/SimplePropertyPoco.cs index 1461fbd..9626af7 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/InputClasses/SimplePropertyPoco.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/InputClasses/SimplePropertyPoco.cs @@ -1,4 +1,5 @@ namespace Jameak.CursorPagination.SourceGenerator.IntegrationTests.InputClasses; + internal record SimplePropertyPoco { public required int IntProp { get; set; } diff --git a/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/KeySetCursorSerializationTests.cs b/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/KeySetCursorSerializationTests.cs index 5080edf..f847383 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/KeySetCursorSerializationTests.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/KeySetCursorSerializationTests.cs @@ -3,6 +3,7 @@ using Jameak.CursorPagination.SourceGenerator.IntegrationTests.PartialStrategies; namespace Jameak.CursorPagination.SourceGenerator.IntegrationTests; + public class KeySetCursorSerializationTests { [Fact] diff --git a/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/KeySetPaginationTests.cs b/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/KeySetPaginationTests.cs index 389e026..9aa0022 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/KeySetPaginationTests.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/KeySetPaginationTests.cs @@ -4,6 +4,7 @@ using Jameak.CursorPagination.SourceGenerator.IntegrationTests.PartialStrategies; namespace Jameak.CursorPagination.SourceGenerator.IntegrationTests; + public class KeySetPaginationTests { private static void AssertStrategyOrdersCorrectly( diff --git a/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/OffsetCursorSerializationTests.cs b/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/OffsetCursorSerializationTests.cs index 02e1804..b0dcf57 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/OffsetCursorSerializationTests.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/OffsetCursorSerializationTests.cs @@ -2,6 +2,7 @@ using Jameak.CursorPagination.Abstractions.OffsetPagination; namespace Jameak.CursorPagination.SourceGenerator.IntegrationTests; + public class OffsetCursorSerializationTests { [Fact] diff --git a/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/OffsetPaginationTests.cs b/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/OffsetPaginationTests.cs index 6520b3f..10e57a2 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/OffsetPaginationTests.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/OffsetPaginationTests.cs @@ -4,6 +4,7 @@ using Jameak.CursorPagination.SourceGenerator.IntegrationTests.PartialStrategies; namespace Jameak.CursorPagination.SourceGenerator.IntegrationTests; + public class OffsetPaginationTests { private static void AssertStrategyOrdersCorrectly( diff --git a/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/TestHelper.cs b/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/TestHelper.cs index 343b20c..2f56545 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/TestHelper.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.IntegrationTests/TestHelper.cs @@ -5,6 +5,7 @@ using Jameak.CursorPagination.SourceGenerator.IntegrationTests.InputClasses; namespace Jameak.CursorPagination.SourceGenerator.IntegrationTests; + internal class TestHelper { public static IEnumerable InfiniteGenerator() diff --git a/test/Jameak.CursorPagination.SourceGenerator.Tests/ErrorTests.cs b/test/Jameak.CursorPagination.SourceGenerator.Tests/ErrorTests.cs index 00316be..f4a6387 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.Tests/ErrorTests.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.Tests/ErrorTests.cs @@ -1,4 +1,5 @@ namespace Jameak.CursorPagination.SourceGenerator.Tests; + public class ErrorTests { private const string ValidPaginatedType = """ diff --git a/test/Jameak.CursorPagination.SourceGenerator.Tests/FullNameOfDiagnosticAnalyzerTests.cs b/test/Jameak.CursorPagination.SourceGenerator.Tests/FullNameOfDiagnosticAnalyzerTests.cs index 865352e..0fe7e2b 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.Tests/FullNameOfDiagnosticAnalyzerTests.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.Tests/FullNameOfDiagnosticAnalyzerTests.cs @@ -1,6 +1,7 @@ using Jameak.CursorPagination.SourceGenerator.Analyzers; namespace Jameak.CursorPagination.SourceGenerator.Tests; + public class FullNameOfDiagnosticAnalyzerTests { [Fact] diff --git a/test/Jameak.CursorPagination.SourceGenerator.Tests/GeneralTests.cs b/test/Jameak.CursorPagination.SourceGenerator.Tests/GeneralTests.cs index a65a8e9..4d5d707 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.Tests/GeneralTests.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.Tests/GeneralTests.cs @@ -1,4 +1,5 @@ namespace Jameak.CursorPagination.SourceGenerator.Tests; + public class GeneralTests { [Fact] diff --git a/test/Jameak.CursorPagination.SourceGenerator.Tests/InternalUsageAnalyzerTests.cs b/test/Jameak.CursorPagination.SourceGenerator.Tests/InternalUsageAnalyzerTests.cs index 9d931c8..71a9edb 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.Tests/InternalUsageAnalyzerTests.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.Tests/InternalUsageAnalyzerTests.cs @@ -1,4 +1,5 @@ namespace Jameak.CursorPagination.SourceGenerator.Tests; + public class InternalUsageAnalyzerTests { [Fact] diff --git a/test/Jameak.CursorPagination.SourceGenerator.Tests/KeySetSpecificTests.cs b/test/Jameak.CursorPagination.SourceGenerator.Tests/KeySetSpecificTests.cs index 01d9e6e..8571c29 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.Tests/KeySetSpecificTests.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.Tests/KeySetSpecificTests.cs @@ -1,4 +1,5 @@ namespace Jameak.CursorPagination.SourceGenerator.Tests; + public class KeySetSpecificTests { private static readonly string s_paginatedType = """ diff --git a/test/Jameak.CursorPagination.SourceGenerator.Tests/ModuleInitializer.cs b/test/Jameak.CursorPagination.SourceGenerator.Tests/ModuleInitializer.cs index f249941..38c3393 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.Tests/ModuleInitializer.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.Tests/ModuleInitializer.cs @@ -1,6 +1,7 @@ using System.Runtime.CompilerServices; namespace Jameak.CursorPagination.SourceGenerator.Tests; + internal static class ModuleInitializer { [ModuleInitializer] diff --git a/test/Jameak.CursorPagination.SourceGenerator.Tests/NestedPropertyTests.cs b/test/Jameak.CursorPagination.SourceGenerator.Tests/NestedPropertyTests.cs index a1d9da6..e0c1f3f 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.Tests/NestedPropertyTests.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.Tests/NestedPropertyTests.cs @@ -1,4 +1,5 @@ namespace Jameak.CursorPagination.SourceGenerator.Tests; + public class NestedPropertyTests { [Fact] diff --git a/test/Jameak.CursorPagination.SourceGenerator.Tests/NullableTests.cs b/test/Jameak.CursorPagination.SourceGenerator.Tests/NullableTests.cs index 1a15630..fba044f 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.Tests/NullableTests.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.Tests/NullableTests.cs @@ -1,4 +1,5 @@ namespace Jameak.CursorPagination.SourceGenerator.Tests; + public class NullableTests { [Fact] diff --git a/test/Jameak.CursorPagination.SourceGenerator.Tests/OffsetSpecificTests.cs b/test/Jameak.CursorPagination.SourceGenerator.Tests/OffsetSpecificTests.cs index 7fe54a1..5633a6a 100644 --- a/test/Jameak.CursorPagination.SourceGenerator.Tests/OffsetSpecificTests.cs +++ b/test/Jameak.CursorPagination.SourceGenerator.Tests/OffsetSpecificTests.cs @@ -1,4 +1,5 @@ namespace Jameak.CursorPagination.SourceGenerator.Tests; + public class OffsetSpecificTests { private static readonly string s_paginatedType = """ diff --git a/test/Jameak.CursorPagination.Tests/AsyncDelegates.cs b/test/Jameak.CursorPagination.Tests/AsyncDelegates.cs index ffb1f38..1d30686 100644 --- a/test/Jameak.CursorPagination.Tests/AsyncDelegates.cs +++ b/test/Jameak.CursorPagination.Tests/AsyncDelegates.cs @@ -1,4 +1,5 @@ namespace Jameak.CursorPagination.Tests; + internal class AsyncDelegates { public static Task> SyncToList(IQueryable queryable) diff --git a/test/Jameak.CursorPagination.Tests/DbClasses/DatabaseFixture.cs b/test/Jameak.CursorPagination.Tests/DbClasses/DatabaseFixture.cs index c6a2c5f..a2ed5d0 100644 --- a/test/Jameak.CursorPagination.Tests/DbClasses/DatabaseFixture.cs +++ b/test/Jameak.CursorPagination.Tests/DbClasses/DatabaseFixture.cs @@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore; namespace Jameak.CursorPagination.Tests.DbClasses; + public sealed class DatabaseFixture : IDisposable { private readonly SqliteConnection _connection; diff --git a/test/Jameak.CursorPagination.Tests/DbClasses/TestDbContext.cs b/test/Jameak.CursorPagination.Tests/DbClasses/TestDbContext.cs index 09b1f9b..992bdb3 100644 --- a/test/Jameak.CursorPagination.Tests/DbClasses/TestDbContext.cs +++ b/test/Jameak.CursorPagination.Tests/DbClasses/TestDbContext.cs @@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore; namespace Jameak.CursorPagination.Tests.DbClasses; + public class TestDbContext : DbContext { private readonly List _logMessages = []; diff --git a/test/Jameak.CursorPagination.Tests/InputClasses/NullablePropertyWithDbComputedColumnPoco.cs b/test/Jameak.CursorPagination.Tests/InputClasses/NullablePropertyWithDbComputedColumnPoco.cs index ba8ca13..aef4684 100644 --- a/test/Jameak.CursorPagination.Tests/InputClasses/NullablePropertyWithDbComputedColumnPoco.cs +++ b/test/Jameak.CursorPagination.Tests/InputClasses/NullablePropertyWithDbComputedColumnPoco.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; namespace Jameak.CursorPagination.Tests.InputClasses; + [PrimaryKey(nameof(PrimaryKeyInt))] [Index(nameof(ComputedIntProp))] public record NullablePropertyWithDbComputedColumnPoco diff --git a/test/Jameak.CursorPagination.Tests/InputClasses/PocoWithNestedProperty.cs b/test/Jameak.CursorPagination.Tests/InputClasses/PocoWithNestedProperty.cs index 7ab0fb0..cc6b580 100644 --- a/test/Jameak.CursorPagination.Tests/InputClasses/PocoWithNestedProperty.cs +++ b/test/Jameak.CursorPagination.Tests/InputClasses/PocoWithNestedProperty.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; namespace Jameak.CursorPagination.Tests.InputClasses; + [PrimaryKey(nameof(IntProp))] public record PocoWithNestedProperty { diff --git a/test/Jameak.CursorPagination.Tests/InputClasses/SimpleFieldPoco.cs b/test/Jameak.CursorPagination.Tests/InputClasses/SimpleFieldPoco.cs index 46123f9..191bd54 100644 --- a/test/Jameak.CursorPagination.Tests/InputClasses/SimpleFieldPoco.cs +++ b/test/Jameak.CursorPagination.Tests/InputClasses/SimpleFieldPoco.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; namespace Jameak.CursorPagination.Tests.InputClasses; + [PrimaryKey(nameof(IntField), nameof(StringField))] public record SimpleFieldPoco { diff --git a/test/Jameak.CursorPagination.Tests/InputClasses/SimplePropertyPoco.cs b/test/Jameak.CursorPagination.Tests/InputClasses/SimplePropertyPoco.cs index 2d88c58..8eb7936 100644 --- a/test/Jameak.CursorPagination.Tests/InputClasses/SimplePropertyPoco.cs +++ b/test/Jameak.CursorPagination.Tests/InputClasses/SimplePropertyPoco.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; namespace Jameak.CursorPagination.Tests.InputClasses; + [PrimaryKey(nameof(IntProp), nameof(StringProp))] public record SimplePropertyPoco { diff --git a/test/Jameak.CursorPagination.Tests/ModuleInitializer.cs b/test/Jameak.CursorPagination.Tests/ModuleInitializer.cs index f14732e..26752a1 100644 --- a/test/Jameak.CursorPagination.Tests/ModuleInitializer.cs +++ b/test/Jameak.CursorPagination.Tests/ModuleInitializer.cs @@ -1,6 +1,7 @@ using System.Runtime.CompilerServices; namespace Jameak.CursorPagination.Tests; + internal static class ModuleInitializer { [ModuleInitializer] diff --git a/test/Jameak.CursorPagination.Tests/NullablePropertyTranslationTests.cs b/test/Jameak.CursorPagination.Tests/NullablePropertyTranslationTests.cs index 47b97d6..395382b 100644 --- a/test/Jameak.CursorPagination.Tests/NullablePropertyTranslationTests.cs +++ b/test/Jameak.CursorPagination.Tests/NullablePropertyTranslationTests.cs @@ -4,6 +4,7 @@ using Jameak.CursorPagination.Tests.InputClasses; namespace Jameak.CursorPagination.Tests; + public class NullablePropertyTranslationTests : IClassFixture { private readonly DatabaseFixture _databaseFactory; diff --git a/test/Jameak.CursorPagination.Tests/OffsetPaginatorTests.cs b/test/Jameak.CursorPagination.Tests/OffsetPaginatorTests.cs index b542f66..dd5e795 100644 --- a/test/Jameak.CursorPagination.Tests/OffsetPaginatorTests.cs +++ b/test/Jameak.CursorPagination.Tests/OffsetPaginatorTests.cs @@ -7,6 +7,7 @@ using Jameak.CursorPagination.Tests.InputClasses; namespace Jameak.CursorPagination.Tests; + public class OffsetPaginatorTests : IClassFixture { private readonly DatabaseFixture _databaseFactory; diff --git a/test/Jameak.CursorPagination.Tests/TestHelper.cs b/test/Jameak.CursorPagination.Tests/TestHelper.cs index 24249e8..a74b013 100644 --- a/test/Jameak.CursorPagination.Tests/TestHelper.cs +++ b/test/Jameak.CursorPagination.Tests/TestHelper.cs @@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore; namespace Jameak.CursorPagination.Tests; + public static partial class TestHelper { public static void CombinePageHelper(LinkedList> combinedList, IReadOnlyList> pageList, PaginationDirection direction) where TCursor : ICursor From b1d17b2515a8dcf408bf19a1c98c033c2cdefeac Mon Sep 17 00:00:00 2001 From: Marcus Winding Quistgaard Date: Fri, 20 Mar 2026 18:25:45 +0100 Subject: [PATCH 2/3] Implement total count optimization for first page queries when less than page size elements are returned --- CHANGELOG.md | 5 ++ Directory.Build.props | 2 +- .../InternalPaginatorHelper.cs | 7 ++ .../KeySetPaginator.cs | 24 ++--- .../OffsetPaginator.cs | 24 ++--- .../KeySetPaginatorTests.cs | 90 +++++++++++++++++++ .../OffsetPaginatorTests.cs | 89 ++++++++++++++++++ ...ckward_computeTotal=EveryPage.verified.txt | 40 ++++----- ...on=Backward_computeTotal=Once.verified.txt | 12 +-- ...orward_computeTotal=EveryPage.verified.txt | 40 ++++----- ...ion=Forward_computeTotal=Once.verified.txt | 12 +-- ...ckward_computeTotal=EveryPage.verified.txt | 40 ++++----- ...on=Backward_computeTotal=Once.verified.txt | 12 +-- ...orward_computeTotal=EveryPage.verified.txt | 40 ++++----- ...ion=Forward_computeTotal=Once.verified.txt | 12 +-- ...ckward_computeTotal=EveryPage.verified.txt | 40 ++++----- ...on=Backward_computeTotal=Once.verified.txt | 12 +-- ...orward_computeTotal=EveryPage.verified.txt | 40 ++++----- ...ion=Forward_computeTotal=Once.verified.txt | 12 +-- ...ckward_computeTotal=EveryPage.verified.txt | 14 +-- ...on=Backward_computeTotal=Once.verified.txt | 12 +-- ...orward_computeTotal=EveryPage.verified.txt | 14 +-- ...ion=Forward_computeTotal=Once.verified.txt | 12 +-- ...ckward_computeTotal=EveryPage.verified.txt | 14 +-- ...on=Backward_computeTotal=Once.verified.txt | 12 +-- ...orward_computeTotal=EveryPage.verified.txt | 14 +-- ...ion=Forward_computeTotal=Once.verified.txt | 12 +-- 27 files changed, 428 insertions(+), 229 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 854cee2..550ef87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [1.2.0] - 2026-03-20 + +Optimization: +- Skip querying the database for the total count when the count can be determined from the number of elements returned from the first page. + ## [1.1.1] - 2026-01-02 Fixes: diff --git a/Directory.Build.props b/Directory.Build.props index e80d61a..8341111 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,7 +7,7 @@ https://github.com/Jameak/CursorPagination cursor paginate pagination keyset offset skip source generator queryable An easy-to-use efficient KeySet- and Offset-pagination implementation for IQueryable with included opaque Cursor support. - 1.1.1 + 1.2.0 $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix) diff --git a/src/Jameak.CursorPagination/InternalPaginatorHelper.cs b/src/Jameak.CursorPagination/InternalPaginatorHelper.cs index e6cf1ad..2ba5614 100644 --- a/src/Jameak.CursorPagination/InternalPaginatorHelper.cs +++ b/src/Jameak.CursorPagination/InternalPaginatorHelper.cs @@ -100,6 +100,13 @@ internal static bool ShouldComputeTotalCount(bool hasAlreadyComputedCount, Compu }; } + internal static bool CanSetTotalCountFromCurrentPageCount(List pageElements, TCursor? cursor, int pageSize) + { + var isFirstPage = cursor == null; + var pageElementsFewerThanRequested = pageElements.Count < pageSize; + return isFirstPage && pageElementsFewerThanRequested; + } + internal static void ThrowIfEnumNotDefined(T argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null) where T : struct, Enum { if (!Enum.IsDefined(argument)) diff --git a/src/Jameak.CursorPagination/KeySetPaginator.cs b/src/Jameak.CursorPagination/KeySetPaginator.cs index f6c882a..ed507cc 100644 --- a/src/Jameak.CursorPagination/KeySetPaginator.cs +++ b/src/Jameak.CursorPagination/KeySetPaginator.cs @@ -46,17 +46,19 @@ private static PageResult InternalApplyPagination( InternalPaginatorHelper.ThrowIfEnumNotDefined(computeNextPage); InternalPaginatorHelper.ThrowIfEnumNotDefined(computeTotalCount); - if (InternalPaginatorHelper.ShouldComputeTotalCount(totalCount.HasValue, computeTotalCount)) - { - totalCount = queryable.Count(); - } - var paginatedQueryable = strategy.ApplyPagination(queryable, pageSize, computeNextPage != ComputeNextPage.Never, paginationDirection, afterCursor); var materialized = paginatedQueryable.ToList(); strategy.PostProcessMaterializedResultInPlace(materialized, pageSize, computeNextPage != ComputeNextPage.Never, paginationDirection, out var hasNextPage); var (previousCursorElement, nextCursorElement) = InternalPaginatorHelper.GetCursorElements(materialized, paginationDirection); + if (InternalPaginatorHelper.ShouldComputeTotalCount(totalCount.HasValue, computeTotalCount)) + { + totalCount = InternalPaginatorHelper.CanSetTotalCountFromCurrentPageCount(materialized, afterCursor, pageSize) + ? materialized.Count + : queryable.Count(); + } + NextPage NextPageGenerator(TCursor nextCursor) { return () => InternalApplyPagination( @@ -196,17 +198,19 @@ private static async Task> InternalApplyPaginationAs InternalPaginatorHelper.ThrowIfEnumNotDefined(computeNextPage); InternalPaginatorHelper.ThrowIfEnumNotDefined(computeTotalCount); - if (InternalPaginatorHelper.ShouldComputeTotalCount(totalCount.HasValue, computeTotalCount)) - { - totalCount = await asyncCountFunc(queryable, cancellationToken); - } - var paginatedQueryable = strategy.ApplyPagination(queryable, pageSize, computeNextPage != ComputeNextPage.Never, paginationDirection, afterCursor); var materialized = await asyncMaterializationFunc(paginatedQueryable, cancellationToken); strategy.PostProcessMaterializedResultInPlace(materialized, pageSize, computeNextPage != ComputeNextPage.Never, paginationDirection, out var hasNextPage); var (previousCursorElement, nextCursorElement) = InternalPaginatorHelper.GetCursorElements(materialized, paginationDirection); + if (InternalPaginatorHelper.ShouldComputeTotalCount(totalCount.HasValue, computeTotalCount)) + { + totalCount = InternalPaginatorHelper.CanSetTotalCountFromCurrentPageCount(materialized, afterCursor, pageSize) + ? materialized.Count + : await asyncCountFunc(queryable, cancellationToken); + } + NextPageAsync NextPageAsyncGenerator(TCursor nextCursor) { return (cancellationToken) => InternalApplyPaginationAsync( diff --git a/src/Jameak.CursorPagination/OffsetPaginator.cs b/src/Jameak.CursorPagination/OffsetPaginator.cs index 54c1211..835acdc 100644 --- a/src/Jameak.CursorPagination/OffsetPaginator.cs +++ b/src/Jameak.CursorPagination/OffsetPaginator.cs @@ -32,11 +32,6 @@ private static PageResult InternalApplyPagination( InternalPaginatorHelper.ThrowIfEnumNotDefined(computeNextPage); InternalPaginatorHelper.ThrowIfEnumNotDefined(computeTotalCount); - if (InternalPaginatorHelper.ShouldComputeTotalCount(totalCount.HasValue, computeTotalCount)) - { - totalCount = queryable.Count(); - } - var paginatedQueryable = strategy.ApplyPagination(queryable, pageSize, computeNextPage != ComputeNextPage.Never, paginationDirection, afterCursor); var materialized = paginatedQueryable.ToList(); @@ -44,6 +39,13 @@ private static PageResult InternalApplyPagination( .ToList(); var (_, nextCursorElement) = InternalPaginatorHelper.GetCursorElements(postProcessed, paginationDirection); + if (InternalPaginatorHelper.ShouldComputeTotalCount(totalCount.HasValue, computeTotalCount)) + { + totalCount = InternalPaginatorHelper.CanSetTotalCountFromCurrentPageCount(postProcessed, afterCursor, pageSize) + ? postProcessed.Count + : queryable.Count(); + } + NextPage NextPageGenerator(OffsetCursor nextCursor) { return () => InternalApplyPagination( @@ -216,11 +218,6 @@ private static async Task> InternalApplyPaginat InternalPaginatorHelper.ThrowIfEnumNotDefined(computeNextPage); InternalPaginatorHelper.ThrowIfEnumNotDefined(computeTotalCount); - if (InternalPaginatorHelper.ShouldComputeTotalCount(totalCount.HasValue, computeTotalCount)) - { - totalCount = await asyncCountFunc(queryable, cancellationToken); - } - var paginatedQueryable = strategy.ApplyPagination(queryable, pageSize, computeNextPage != ComputeNextPage.Never, paginationDirection, afterCursor); var materialized = await asyncMaterializationFunc(paginatedQueryable, cancellationToken); @@ -229,6 +226,13 @@ private static async Task> InternalApplyPaginat var (_, nextCursorElement) = InternalPaginatorHelper.GetCursorElements(postProcessed, paginationDirection); + if (InternalPaginatorHelper.ShouldComputeTotalCount(totalCount.HasValue, computeTotalCount)) + { + totalCount = InternalPaginatorHelper.CanSetTotalCountFromCurrentPageCount(postProcessed, afterCursor, pageSize) + ? postProcessed.Count + : await asyncCountFunc(queryable, cancellationToken); + } + NextPageAsync NextPageAsyncGenerator(OffsetCursor nextCursor) { return (cancellationToken) => InternalApplyPaginationAsync( diff --git a/test/Jameak.CursorPagination.Tests/KeySetPaginatorTests.cs b/test/Jameak.CursorPagination.Tests/KeySetPaginatorTests.cs index effc56f..e05aec1 100644 --- a/test/Jameak.CursorPagination.Tests/KeySetPaginatorTests.cs +++ b/test/Jameak.CursorPagination.Tests/KeySetPaginatorTests.cs @@ -6,6 +6,7 @@ using Jameak.CursorPagination.Tests.DbClasses; using Jameak.CursorPagination.Tests.InputClasses; using Microsoft.EntityFrameworkCore; +using Xunit.Sdk; namespace Jameak.CursorPagination.Tests; @@ -332,4 +333,93 @@ public void NestedPropertiesWork() dbContext => dbContext.PocoWithNestedPropertyTestTable.Include(e => e.NestedData).AsQueryable(), (dbContext => PocoWithNestedPropertyKeySetStrategyTestHelper.ApplyExpectedCorrectOrderForwardDirection(dbContext.PocoWithNestedPropertyTestTable.Include(e => e.NestedData).AsQueryable()))); } + + [Theory] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.Once, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.EveryPage, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.EveryPage, ComputeNextPage.Never)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.Once, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.EveryPage, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.EveryPage, ComputeNextPage.Never)] + public async Task TotalCountComputedViaFirstPageOptimizationDoesNotHitDatabase_Async(PaginationDirection direction, ComputeTotalCount computeTotal, ComputeNextPage computeNextPage) + { + var strategy = new SimplePropertyKeySetStrategy(); + var dbContext = _databaseFactory.CreateDbContext(); + + // Act & Assert + var firstPage = await KeySetPaginator.ApplyPaginationAsync( + strategy, + TestHelper.TagTestQueryable(dbContext.SimplePropertyTestTable), + asyncMaterializationFunc: (queryable, _) => AsyncDelegates.SyncToList(queryable), + asyncCountFunc: (queryable, _) => throw new XunitException("When this optimization is hit, the code should never try to execute the Count-func"), + asyncAnyFunc: (queryable, _) => AsyncDelegates.SyncAny(queryable), + afterCursor: null, + pageSize: 999_999, // Page size higher than total number of elements in the table. + computeNextPage: computeNextPage, + computeTotalCount: computeTotal, + paginationDirection: direction); + + var dbLogs = TestHelper.TaggedLogMessages(dbContext); + Assert.NotEmpty(dbLogs); + Assert.DoesNotContain("COUNT", string.Join("\n", dbLogs), StringComparison.InvariantCultureIgnoreCase); + Assert.Equal(dbContext.SimplePropertyTestTable.Count(), firstPage.TotalCount); + } + + [Theory] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.Once, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.EveryPage, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.EveryPage, ComputeNextPage.Never)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.Once, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.EveryPage, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.EveryPage, ComputeNextPage.Never)] + public async Task TotalCountComputedViaFirstPageOptimizationDoesNotHitDatabase(PaginationDirection direction, ComputeTotalCount computeTotal, ComputeNextPage computeNextPage) + { + var strategy = new SimplePropertyKeySetStrategy(); + var dbContext = _databaseFactory.CreateDbContext(); + + // Act + var firstPage = KeySetPaginator.ApplyPagination( + strategy, + TestHelper.TagTestQueryable(dbContext.SimplePropertyTestTable), + afterCursor: null, + pageSize: 999_999, // Page size higher than total number of elements in the table. + computeNextPage: computeNextPage, + computeTotalCount: computeTotal, + paginationDirection: direction); + + // Assert + var dbLogs = TestHelper.TaggedLogMessages(dbContext); + Assert.NotEmpty(dbLogs); + Assert.DoesNotContain("COUNT", string.Join("\n", dbLogs), StringComparison.InvariantCultureIgnoreCase); + Assert.Equal(dbContext.SimplePropertyTestTable.Count(), firstPage.TotalCount); + } + + [Theory] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.Once, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.EveryPage, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.EveryPage, ComputeNextPage.Never)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.Once, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.EveryPage, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.EveryPage, ComputeNextPage.Never)] + public async Task TotalCountIsCorrectForPageSizeZero(PaginationDirection direction, ComputeTotalCount computeTotal, ComputeNextPage computeNextPage) + { + var strategy = new SimplePropertyKeySetStrategy(); + var dbContext = _databaseFactory.CreateDbContext(); + + // Act + var firstPage = KeySetPaginator.ApplyPagination( + strategy, + TestHelper.TagTestQueryable(dbContext.SimplePropertyTestTable), + afterCursor: null, + pageSize: 0, + computeNextPage: computeNextPage, + computeTotalCount: computeTotal, + paginationDirection: direction); + + // Assert + var dbLogs = TestHelper.TaggedLogMessages(dbContext); + Assert.NotEmpty(dbLogs); + Assert.Contains("COUNT", string.Join("\n", dbLogs), StringComparison.InvariantCultureIgnoreCase); + Assert.Equal(dbContext.SimplePropertyTestTable.Count(), firstPage.TotalCount); + } } diff --git a/test/Jameak.CursorPagination.Tests/OffsetPaginatorTests.cs b/test/Jameak.CursorPagination.Tests/OffsetPaginatorTests.cs index dd5e795..7868565 100644 --- a/test/Jameak.CursorPagination.Tests/OffsetPaginatorTests.cs +++ b/test/Jameak.CursorPagination.Tests/OffsetPaginatorTests.cs @@ -5,6 +5,7 @@ using Jameak.CursorPagination.Page; using Jameak.CursorPagination.Tests.DbClasses; using Jameak.CursorPagination.Tests.InputClasses; +using Xunit.Sdk; namespace Jameak.CursorPagination.Tests; @@ -212,4 +213,92 @@ public void HasPreviousPage_VerifyBehavior() Assert.True(notFirst.HasPreviousPage()); } + + [Theory] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.Once, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.EveryPage, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.EveryPage, ComputeNextPage.Never)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.Once, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.EveryPage, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.EveryPage, ComputeNextPage.Never)] + public async Task TotalCountComputedViaFirstPageOptimizationDoesNotHitDatabase_Async(PaginationDirection direction, ComputeTotalCount computeTotal, ComputeNextPage computeNextPage) + { + var strategy = new SimplePropertyOffsetStrategy(); + var dbContext = _databaseFactory.CreateDbContext(); + + // Act & Assert + var firstPage = await OffsetPaginator.ApplyPaginationAsync( + strategy, + TestHelper.TagTestQueryable(dbContext.SimplePropertyTestTable), + asyncMaterializationFunc: (queryable, _) => AsyncDelegates.SyncToList(queryable), + asyncCountFunc: (queryable, _) => throw new XunitException("When this optimization is hit, the code should never try to execute the Count-func"), + afterCursor: null, + pageSize: 999_999, // Page size higher than total number of elements in the table. + computeNextPage: computeNextPage, + computeTotalCount: computeTotal, + paginationDirection: direction); + + var dbLogs = TestHelper.TaggedLogMessages(dbContext); + Assert.NotEmpty(dbLogs); + Assert.DoesNotContain("COUNT", string.Join("\n", dbLogs), StringComparison.InvariantCultureIgnoreCase); + Assert.Equal(dbContext.SimplePropertyTestTable.Count(), firstPage.TotalCount); + } + + [Theory] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.Once, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.EveryPage, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.EveryPage, ComputeNextPage.Never)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.Once, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.EveryPage, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.EveryPage, ComputeNextPage.Never)] + public async Task TotalCountComputedViaFirstPageOptimizationDoesNotHitDatabase(PaginationDirection direction, ComputeTotalCount computeTotal, ComputeNextPage computeNextPage) + { + var strategy = new SimplePropertyOffsetStrategy(); + var dbContext = _databaseFactory.CreateDbContext(); + + // Act + var firstPage = OffsetPaginator.ApplyPagination( + strategy, + TestHelper.TagTestQueryable(dbContext.SimplePropertyTestTable), + afterCursor: null, + pageSize: 999_999, // Page size higher than total number of elements in the table. + computeNextPage: computeNextPage, + computeTotalCount: computeTotal, + paginationDirection: direction); + + // Assert + var dbLogs = TestHelper.TaggedLogMessages(dbContext); + Assert.NotEmpty(dbLogs); + Assert.DoesNotContain("COUNT", string.Join("\n", dbLogs), StringComparison.InvariantCultureIgnoreCase); + Assert.Equal(dbContext.SimplePropertyTestTable.Count(), firstPage.TotalCount); + } + + [Theory] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.Once, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.EveryPage, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Forward, ComputeTotalCount.EveryPage, ComputeNextPage.Never)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.Once, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.EveryPage, ComputeNextPage.EveryPage)] + [InlineData(PaginationDirection.Backward, ComputeTotalCount.EveryPage, ComputeNextPage.Never)] + public async Task TotalCountIsCorrectForPageSizeZero(PaginationDirection direction, ComputeTotalCount computeTotal, ComputeNextPage computeNextPage) + { + var strategy = new SimplePropertyOffsetStrategy(); + var dbContext = _databaseFactory.CreateDbContext(); + + // Act + var firstPage = OffsetPaginator.ApplyPagination( + strategy, + TestHelper.TagTestQueryable(dbContext.SimplePropertyTestTable), + afterCursor: null, + pageSize: 0, + computeNextPage: computeNextPage, + computeTotalCount: computeTotal, + paginationDirection: direction); + + // Assert + var dbLogs = TestHelper.TaggedLogMessages(dbContext); + Assert.NotEmpty(dbLogs); + Assert.Contains("COUNT", string.Join("\n", dbLogs), StringComparison.InvariantCultureIgnoreCase); + Assert.Equal(dbContext.SimplePropertyTestTable.Count(), firstPage.TotalCount); + } } diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt index df8c889..00a6b7b 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntProp", "s"."StringProp" FROM "SimplePropertyTestTable" AS "s" + ORDER BY "s"."IntProp" DESC, "s"."StringProp" + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntProp", "s"."StringProp" + SELECT COUNT(*) FROM "SimplePropertyTestTable" AS "s" - ORDER BY "s"."IntProp" DESC, "s"."StringProp" - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='6', @__StringPropValue_1='e' (Size = 1)], CommandType='Text', CommandTimeout='30'] @@ -24,13 +24,6 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimplePropertyTestTable" AS "s" WHERE "s"."IntProp" >= @__IntPropValue_0 AND ("s"."IntProp" > @__IntPropValue_0 OR ("s"."IntProp" = @__IntPropValue_0 AND "s"."StringProp" < @__StringPropValue_1))) -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimplePropertyTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='4', @__StringPropValue_1='e' (Size = 1), @__p_2='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -41,6 +34,13 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da ORDER BY "s"."IntProp" DESC, "s"."StringProp" LIMIT @__p_2 +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimplePropertyTestTable" AS "s" + info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='3', @__StringPropValue_1='b' (Size = 1)], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -50,13 +50,6 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimplePropertyTestTable" AS "s" WHERE "s"."IntProp" >= @__IntPropValue_0 AND ("s"."IntProp" > @__IntPropValue_0 OR ("s"."IntProp" = @__IntPropValue_0 AND "s"."StringProp" < @__StringPropValue_1))) -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimplePropertyTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='3', @__StringPropValue_1='d' (Size = 1), @__p_2='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -67,6 +60,13 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da ORDER BY "s"."IntProp" DESC, "s"."StringProp" LIMIT @__p_2 +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimplePropertyTestTable" AS "s" + info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='2', @__StringPropValue_1='b' (Size = 1)], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=Once.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=Once.verified.txt index 10584aa..9fe07e3 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=Once.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=Once.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntProp", "s"."StringProp" FROM "SimplePropertyTestTable" AS "s" + ORDER BY "s"."IntProp" DESC, "s"."StringProp" + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntProp", "s"."StringProp" + SELECT COUNT(*) FROM "SimplePropertyTestTable" AS "s" - ORDER BY "s"."IntProp" DESC, "s"."StringProp" - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='6', @__StringPropValue_1='e' (Size = 1)], CommandType='Text', CommandTimeout='30'] diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt index 61dfe6b..19ac00b 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntProp", "s"."StringProp" FROM "SimplePropertyTestTable" AS "s" + ORDER BY "s"."IntProp", "s"."StringProp" DESC + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntProp", "s"."StringProp" + SELECT COUNT(*) FROM "SimplePropertyTestTable" AS "s" - ORDER BY "s"."IntProp", "s"."StringProp" DESC - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='1', @__StringPropValue_1='a' (Size = 1)], CommandType='Text', CommandTimeout='30'] @@ -24,13 +24,6 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimplePropertyTestTable" AS "s" WHERE "s"."IntProp" <= @__IntPropValue_0 AND ("s"."IntProp" < @__IntPropValue_0 OR ("s"."IntProp" = @__IntPropValue_0 AND "s"."StringProp" > @__StringPropValue_1))) -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimplePropertyTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='3', @__StringPropValue_1='d' (Size = 1), @__p_2='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -41,6 +34,13 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da ORDER BY "s"."IntProp", "s"."StringProp" DESC LIMIT @__p_2 +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimplePropertyTestTable" AS "s" + info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='3', @__StringPropValue_1='c' (Size = 1)], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -50,13 +50,6 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimplePropertyTestTable" AS "s" WHERE "s"."IntProp" <= @__IntPropValue_0 AND ("s"."IntProp" < @__IntPropValue_0 OR ("s"."IntProp" = @__IntPropValue_0 AND "s"."StringProp" > @__StringPropValue_1))) -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimplePropertyTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='4', @__StringPropValue_1='e' (Size = 1), @__p_2='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -67,6 +60,13 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da ORDER BY "s"."IntProp", "s"."StringProp" DESC LIMIT @__p_2 +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimplePropertyTestTable" AS "s" + info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='5', @__StringPropValue_1='e' (Size = 1)], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=Once.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=Once.verified.txt index 177fe47..456bfe7 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=Once.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=Once.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntProp", "s"."StringProp" FROM "SimplePropertyTestTable" AS "s" + ORDER BY "s"."IntProp", "s"."StringProp" DESC + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntProp", "s"."StringProp" + SELECT COUNT(*) FROM "SimplePropertyTestTable" AS "s" - ORDER BY "s"."IntProp", "s"."StringProp" DESC - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='1', @__StringPropValue_1='a' (Size = 1)], CommandType='Text', CommandTimeout='30'] diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Backward_computeTotal=EveryPage.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Backward_computeTotal=EveryPage.verified.txt index d689f27..16b8dcd 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Backward_computeTotal=EveryPage.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Backward_computeTotal=EveryPage.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntField", "s"."StringField" FROM "SimpleFieldTestTable" AS "s" + ORDER BY "s"."IntField" DESC, "s"."StringField" + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntField", "s"."StringField" + SELECT COUNT(*) FROM "SimpleFieldTestTable" AS "s" - ORDER BY "s"."IntField" DESC, "s"."StringField" - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntFieldValue_0='6', @__StringFieldValue_1='e' (Size = 1)], CommandType='Text', CommandTimeout='30'] @@ -24,13 +24,6 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimpleFieldTestTable" AS "s" WHERE "s"."IntField" >= @__IntFieldValue_0 AND ("s"."IntField" > @__IntFieldValue_0 OR ("s"."IntField" = @__IntFieldValue_0 AND "s"."StringField" < @__StringFieldValue_1))) -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimpleFieldTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntFieldValue_0='4', @__StringFieldValue_1='e' (Size = 1), @__p_2='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -41,6 +34,13 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da ORDER BY "s"."IntField" DESC, "s"."StringField" LIMIT @__p_2 +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimpleFieldTestTable" AS "s" + info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntFieldValue_0='3', @__StringFieldValue_1='b' (Size = 1)], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -50,13 +50,6 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimpleFieldTestTable" AS "s" WHERE "s"."IntField" >= @__IntFieldValue_0 AND ("s"."IntField" > @__IntFieldValue_0 OR ("s"."IntField" = @__IntFieldValue_0 AND "s"."StringField" < @__StringFieldValue_1))) -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimpleFieldTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntFieldValue_0='3', @__StringFieldValue_1='d' (Size = 1), @__p_2='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -67,6 +60,13 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da ORDER BY "s"."IntField" DESC, "s"."StringField" LIMIT @__p_2 +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimpleFieldTestTable" AS "s" + info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntFieldValue_0='2', @__StringFieldValue_1='b' (Size = 1)], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Backward_computeTotal=Once.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Backward_computeTotal=Once.verified.txt index 72379f3..0562c5c 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Backward_computeTotal=Once.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Backward_computeTotal=Once.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntField", "s"."StringField" FROM "SimpleFieldTestTable" AS "s" + ORDER BY "s"."IntField" DESC, "s"."StringField" + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntField", "s"."StringField" + SELECT COUNT(*) FROM "SimpleFieldTestTable" AS "s" - ORDER BY "s"."IntField" DESC, "s"."StringField" - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntFieldValue_0='6', @__StringFieldValue_1='e' (Size = 1)], CommandType='Text', CommandTimeout='30'] diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Forward_computeTotal=EveryPage.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Forward_computeTotal=EveryPage.verified.txt index a7dc41d..7f7fe35 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Forward_computeTotal=EveryPage.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Forward_computeTotal=EveryPage.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntField", "s"."StringField" FROM "SimpleFieldTestTable" AS "s" + ORDER BY "s"."IntField", "s"."StringField" DESC + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntField", "s"."StringField" + SELECT COUNT(*) FROM "SimpleFieldTestTable" AS "s" - ORDER BY "s"."IntField", "s"."StringField" DESC - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntFieldValue_0='1', @__StringFieldValue_1='a' (Size = 1)], CommandType='Text', CommandTimeout='30'] @@ -24,13 +24,6 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimpleFieldTestTable" AS "s" WHERE "s"."IntField" <= @__IntFieldValue_0 AND ("s"."IntField" < @__IntFieldValue_0 OR ("s"."IntField" = @__IntFieldValue_0 AND "s"."StringField" > @__StringFieldValue_1))) -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimpleFieldTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntFieldValue_0='3', @__StringFieldValue_1='d' (Size = 1), @__p_2='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -41,6 +34,13 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da ORDER BY "s"."IntField", "s"."StringField" DESC LIMIT @__p_2 +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimpleFieldTestTable" AS "s" + info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntFieldValue_0='3', @__StringFieldValue_1='c' (Size = 1)], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -50,13 +50,6 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimpleFieldTestTable" AS "s" WHERE "s"."IntField" <= @__IntFieldValue_0 AND ("s"."IntField" < @__IntFieldValue_0 OR ("s"."IntField" = @__IntFieldValue_0 AND "s"."StringField" > @__StringFieldValue_1))) -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimpleFieldTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntFieldValue_0='4', @__StringFieldValue_1='e' (Size = 1), @__p_2='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -67,6 +60,13 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da ORDER BY "s"."IntField", "s"."StringField" DESC LIMIT @__p_2 +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimpleFieldTestTable" AS "s" + info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntFieldValue_0='5', @__StringFieldValue_1='e' (Size = 1)], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Forward_computeTotal=Once.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Forward_computeTotal=Once.verified.txt index 7f594dd..804e131 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Forward_computeTotal=Once.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_WithEfModelUsingFields_direction=Forward_computeTotal=Once.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntField", "s"."StringField" FROM "SimpleFieldTestTable" AS "s" + ORDER BY "s"."IntField", "s"."StringField" DESC + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntField", "s"."StringField" + SELECT COUNT(*) FROM "SimpleFieldTestTable" AS "s" - ORDER BY "s"."IntField", "s"."StringField" DESC - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntFieldValue_0='1', @__StringFieldValue_1='a' (Size = 1)], CommandType='Text', CommandTimeout='30'] diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt index df8c889..00a6b7b 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntProp", "s"."StringProp" FROM "SimplePropertyTestTable" AS "s" + ORDER BY "s"."IntProp" DESC, "s"."StringProp" + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntProp", "s"."StringProp" + SELECT COUNT(*) FROM "SimplePropertyTestTable" AS "s" - ORDER BY "s"."IntProp" DESC, "s"."StringProp" - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='6', @__StringPropValue_1='e' (Size = 1)], CommandType='Text', CommandTimeout='30'] @@ -24,13 +24,6 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimplePropertyTestTable" AS "s" WHERE "s"."IntProp" >= @__IntPropValue_0 AND ("s"."IntProp" > @__IntPropValue_0 OR ("s"."IntProp" = @__IntPropValue_0 AND "s"."StringProp" < @__StringPropValue_1))) -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimplePropertyTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='4', @__StringPropValue_1='e' (Size = 1), @__p_2='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -41,6 +34,13 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da ORDER BY "s"."IntProp" DESC, "s"."StringProp" LIMIT @__p_2 +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimplePropertyTestTable" AS "s" + info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='3', @__StringPropValue_1='b' (Size = 1)], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -50,13 +50,6 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimplePropertyTestTable" AS "s" WHERE "s"."IntProp" >= @__IntPropValue_0 AND ("s"."IntProp" > @__IntPropValue_0 OR ("s"."IntProp" = @__IntPropValue_0 AND "s"."StringProp" < @__StringPropValue_1))) -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimplePropertyTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='3', @__StringPropValue_1='d' (Size = 1), @__p_2='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -67,6 +60,13 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da ORDER BY "s"."IntProp" DESC, "s"."StringProp" LIMIT @__p_2 +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimplePropertyTestTable" AS "s" + info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='2', @__StringPropValue_1='b' (Size = 1)], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=Once.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=Once.verified.txt index 10584aa..9fe07e3 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=Once.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=Once.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntProp", "s"."StringProp" FROM "SimplePropertyTestTable" AS "s" + ORDER BY "s"."IntProp" DESC, "s"."StringProp" + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntProp", "s"."StringProp" + SELECT COUNT(*) FROM "SimplePropertyTestTable" AS "s" - ORDER BY "s"."IntProp" DESC, "s"."StringProp" - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='6', @__StringPropValue_1='e' (Size = 1)], CommandType='Text', CommandTimeout='30'] diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt index 61dfe6b..19ac00b 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntProp", "s"."StringProp" FROM "SimplePropertyTestTable" AS "s" + ORDER BY "s"."IntProp", "s"."StringProp" DESC + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntProp", "s"."StringProp" + SELECT COUNT(*) FROM "SimplePropertyTestTable" AS "s" - ORDER BY "s"."IntProp", "s"."StringProp" DESC - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='1', @__StringPropValue_1='a' (Size = 1)], CommandType='Text', CommandTimeout='30'] @@ -24,13 +24,6 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimplePropertyTestTable" AS "s" WHERE "s"."IntProp" <= @__IntPropValue_0 AND ("s"."IntProp" < @__IntPropValue_0 OR ("s"."IntProp" = @__IntPropValue_0 AND "s"."StringProp" > @__StringPropValue_1))) -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimplePropertyTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='3', @__StringPropValue_1='d' (Size = 1), @__p_2='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -41,6 +34,13 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da ORDER BY "s"."IntProp", "s"."StringProp" DESC LIMIT @__p_2 +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimplePropertyTestTable" AS "s" + info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='3', @__StringPropValue_1='c' (Size = 1)], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -50,13 +50,6 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimplePropertyTestTable" AS "s" WHERE "s"."IntProp" <= @__IntPropValue_0 AND ("s"."IntProp" < @__IntPropValue_0 OR ("s"."IntProp" = @__IntPropValue_0 AND "s"."StringProp" > @__StringPropValue_1))) -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimplePropertyTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='4', @__StringPropValue_1='e' (Size = 1), @__p_2='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -67,6 +60,13 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da ORDER BY "s"."IntProp", "s"."StringProp" DESC LIMIT @__p_2 +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimplePropertyTestTable" AS "s" + info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='5', @__StringPropValue_1='e' (Size = 1)], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=Once.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=Once.verified.txt index 177fe47..456bfe7 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=Once.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/KeySetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=Once.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntProp", "s"."StringProp" FROM "SimplePropertyTestTable" AS "s" + ORDER BY "s"."IntProp", "s"."StringProp" DESC + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntProp", "s"."StringProp" + SELECT COUNT(*) FROM "SimplePropertyTestTable" AS "s" - ORDER BY "s"."IntProp", "s"."StringProp" DESC - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__IntPropValue_0='1', @__StringPropValue_1='a' (Size = 1)], CommandType='Text', CommandTimeout='30'] diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt index 6524bd5..bbf1969 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt @@ -1,11 +1,4 @@ [ -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimplePropertyTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -46,4 +39,11 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimplePropertyTestTable" AS "s" ORDER BY "s"."IntProp" DESC, "s"."StringProp" LIMIT @__p_1 OFFSET @__p_0 + +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimplePropertyTestTable" AS "s" ] \ No newline at end of file diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=Once.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=Once.verified.txt index 34a6a78..17e18a4 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=Once.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Backward_computeTotal=Once.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntProp", "s"."StringProp" FROM "SimplePropertyTestTable" AS "s" + ORDER BY "s"."IntProp" DESC, "s"."StringProp" + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntProp", "s"."StringProp" + SELECT COUNT(*) FROM "SimplePropertyTestTable" AS "s" - ORDER BY "s"."IntProp" DESC, "s"."StringProp" - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__p_1='4', @__p_0='3'], CommandType='Text', CommandTimeout='30'] diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt index 80eaa5d..2061243 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt @@ -1,11 +1,4 @@ [ -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimplePropertyTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -46,4 +39,11 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimplePropertyTestTable" AS "s" ORDER BY "s"."IntProp", "s"."StringProp" DESC LIMIT @__p_1 OFFSET @__p_0 + +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimplePropertyTestTable" AS "s" ] \ No newline at end of file diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=Once.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=Once.verified.txt index b72a3d0..aa6dd6c 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=Once.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckAsyncPagination_direction=Forward_computeTotal=Once.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntProp", "s"."StringProp" FROM "SimplePropertyTestTable" AS "s" + ORDER BY "s"."IntProp", "s"."StringProp" DESC + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntProp", "s"."StringProp" + SELECT COUNT(*) FROM "SimplePropertyTestTable" AS "s" - ORDER BY "s"."IntProp", "s"."StringProp" DESC - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__p_1='4', @__p_0='3'], CommandType='Text', CommandTimeout='30'] diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt index 6524bd5..bbf1969 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=EveryPage.verified.txt @@ -1,11 +1,4 @@ [ -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimplePropertyTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -46,4 +39,11 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimplePropertyTestTable" AS "s" ORDER BY "s"."IntProp" DESC, "s"."StringProp" LIMIT @__p_1 OFFSET @__p_0 + +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimplePropertyTestTable" AS "s" ] \ No newline at end of file diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=Once.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=Once.verified.txt index 34a6a78..17e18a4 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=Once.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Backward_computeTotal=Once.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntProp", "s"."StringProp" FROM "SimplePropertyTestTable" AS "s" + ORDER BY "s"."IntProp" DESC, "s"."StringProp" + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntProp", "s"."StringProp" + SELECT COUNT(*) FROM "SimplePropertyTestTable" AS "s" - ORDER BY "s"."IntProp" DESC, "s"."StringProp" - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__p_1='4', @__p_0='3'], CommandType='Text', CommandTimeout='30'] diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt index 80eaa5d..2061243 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=EveryPage.verified.txt @@ -1,11 +1,4 @@ [ -info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] - -- TaggedTestQueryable - - SELECT COUNT(*) - FROM "SimplePropertyTestTable" AS "s" - info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable @@ -46,4 +39,11 @@ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Da FROM "SimplePropertyTestTable" AS "s" ORDER BY "s"."IntProp", "s"."StringProp" DESC LIMIT @__p_1 OFFSET @__p_0 + +info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + -- TaggedTestQueryable + + SELECT COUNT(*) + FROM "SimplePropertyTestTable" AS "s" ] \ No newline at end of file diff --git a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=Once.verified.txt b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=Once.verified.txt index b72a3d0..aa6dd6c 100644 --- a/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=Once.verified.txt +++ b/test/Jameak.CursorPagination.Tests/__snapshots__/OffsetPaginatorTests.CheckSyncPagination_direction=Forward_computeTotal=Once.verified.txt @@ -1,19 +1,19 @@ [ info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT COUNT(*) + SELECT "s"."IntProp", "s"."StringProp" FROM "SimplePropertyTestTable" AS "s" + ORDER BY "s"."IntProp", "s"."StringProp" DESC + LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) - Executed DbCommand (scrubbed execution time) [Parameters=[@__p_0='4'], CommandType='Text', CommandTimeout='30'] + Executed DbCommand (scrubbed execution time) [Parameters=[], CommandType='Text', CommandTimeout='30'] -- TaggedTestQueryable - SELECT "s"."IntProp", "s"."StringProp" + SELECT COUNT(*) FROM "SimplePropertyTestTable" AS "s" - ORDER BY "s"."IntProp", "s"."StringProp" DESC - LIMIT @__p_0 info: RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command) Executed DbCommand (scrubbed execution time) [Parameters=[@__p_1='4', @__p_0='3'], CommandType='Text', CommandTimeout='30'] From 396abee254b1faaef5577c87f374586013fca115 Mon Sep 17 00:00:00 2001 From: Marcus Winding Quistgaard Date: Fri, 20 Mar 2026 18:40:44 +0100 Subject: [PATCH 3/3] Make sonarqube happy --- src/Jameak.CursorPagination/InternalPaginatorHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Jameak.CursorPagination/InternalPaginatorHelper.cs b/src/Jameak.CursorPagination/InternalPaginatorHelper.cs index 2ba5614..95ae747 100644 --- a/src/Jameak.CursorPagination/InternalPaginatorHelper.cs +++ b/src/Jameak.CursorPagination/InternalPaginatorHelper.cs @@ -100,7 +100,7 @@ internal static bool ShouldComputeTotalCount(bool hasAlreadyComputedCount, Compu }; } - internal static bool CanSetTotalCountFromCurrentPageCount(List pageElements, TCursor? cursor, int pageSize) + internal static bool CanSetTotalCountFromCurrentPageCount(List pageElements, TCursor? cursor, int pageSize) where TCursor : class { var isFirstPage = cursor == null; var pageElementsFewerThanRequested = pageElements.Count < pageSize;