zzzprojects / EntityFramework-Plus

Entity Framework Plus extends your DbContext with must-haves features: Include Filter, Auditing, Caching, Query Future, Batch Delete, Batch Update, and more
https://entityframework-plus.net/
MIT License
2.27k stars 318 forks source link

DeleteAsync with Take on PostgreSQL #808

Closed r-ising closed 1 month ago

r-ising commented 2 months ago

1. Description

DeleteAsync not working correctly with .Take() after upgrade from 8.103.1 to 8.103.3

2. Any further technical details

Code example

var person1 = await Context.Set<PersonEntity>()
    .AsNoTracking()
    .FirstOrDefaultAsync();

await Context.Set<PersonEntity>()
    .AsNoTracking()
    .Where(p => p.Id == person1.Id)
    .Take(1)
    .DeleteAsync();

var person2 = await Context.Set<PersonEntity>()
    .AsNoTracking()
    .FirstOrDefaultAsync(p => p.Id == person1.Id);
// person2 is not null

If we remove the ".Take(1)" then person2 is null and it works correctly.

Further technical details

JonathanMagnan commented 2 months ago

Hello @r-ising ,

Thank you for reporting.

We will look at it.

Best Regards,

Jon

JonathanMagnan commented 2 months ago

Hello @r-ising .

Just to confirm that the issue has been fixed.

The fix will be released on September 24.

Best Regards,

Jon

r-ising commented 1 month ago

@JonathanMagnan Thanks, that sounds good to me.

JonathanMagnan commented 1 month ago

Hello @r-ising ,

The v8.103.4.0 has been released today: https://github.com/zzzprojects/EntityFramework-Plus/releases/tag/8.103.4.0

Let me know if my developer correctly fixed your issue.

Best Regards,

Jon