Skip to content

.Net 8 have problems while trying apply skip() or take() after sorting with json columns #3066

@SergMarkovych

Description

@SergMarkovych

.Net8
Microsoft.EntityFrameworkCore 8.0.1.
Microsoft.EntityFrameworkCore.SqlServer 8.0.1

Have problems while trying apply skip() or take() after sorting json columns.

The error is Message: Invalid column name 'key'. Number 207;
As you can see in this query, the system-generated key column is not included in the WITH clause.

https://github.com/SergMarkovych/Ef_TestPaginationIssueApp

When I process JSON columns in my script and use OrderBy() and then the Skip() or Take() methods, the script breaks. However, this problem only seems to occur when I also include data from non-JSON columns in my DTO (Data Transfer Object).

If I exclude ordering (i.e. OrderBy()) or pagination (i.e. Skip() or Take() methods), the script is generated correctly and without any problems.

Interesting: If I comment out the FullNumber column, which is not a JSON column, the script works fine even with the OrderBy(), Skip() and Take() methods enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions