Talpers/delete range by spec - #369
Conversation
fiseni
commented
Sep 5, 2023
Hi @thorstenalpers, Thank you for your work. It looks great. I'd suggest, deleting a different entity in each test (passing a different id). I think we're seeding many products, so just use 1,2,3, and so on. Let me know if you face any issues. |
Hi @fiseni, thanks for the help. Yes, I have an issue with EF6 and deleting entities using specs that use .AsNoTracking() to query entities. With EfCore the test with deletion was successful. Failed Test: DeletesProductWithIdOne_GivenProductByIdAsUntrackedSpec() For me a deletion by a query as untracked makes no sense either. Should I remove these tests? I have temporary removed them, what do you think about it? |
fiseni
commented
Sep 8, 2023
Hey @thorstenalpers, It looks fine, thanks. It's a little bit dubious that we're not explicitly loading the entities (e.g. use ToListAsync, or LoadAsync), but we're passing an varquery=ApplySpecification(specification);_dbContext.Set<T>().RemoveRange(query); |
Uh oh!
There was an error while loading. Please reload this page.
hgedik
commented
Oct 10, 2023
Could you please update Nuget as well? :) |
New feature DeleteRange by specification