-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed as duplicate of#26808
Labels
Description
Bug description
Hello.
I found a problem with "Skip" when querying an entity with a negative ID - the "Include" mechanism breaks.
Initially, the query was more complex, but I managed to simplify it to the state shown in the screenshots.
Reproduced on packages:
Microsoft.EntityFrameworkCore.Design Version 8.0.11
Microsoft.EntityFrameworkCore.Tools Version 8.0.11
Npgsql Version 8.0.6
Npgsql.EntityFrameworkCore.PostgreSQL Version 8.0.11
Unfortunately, there is no way to check on later versions.
P.S. I'm sorry, but I don't have the ability to write a console application that reproduces the issue.
Your code
var normalObj = await context
.Set<MyObject>()
.AsNoTracking()
.Include(s => s.Kinds)
.FirstAsync(s => s.Id == -8001);
var brokenIncludeList = await context
.Set<MyObject>()
.AsNoTracking()
.Include(s => s.Kinds)
.Skip(1)
.ToListAsync();
var brokenInclude = brokenIncludeList.First(s => s.Id == -8001);Stack traces
The error is related to the system's behavior rather than the thrown exception
Verbose output
EF Core version
8.0.11
Database provider
Npgsql
Target framework
.NET 8.0
Operating system
Windows 10
IDE
JetBrains Rider 2023.3.4