-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Talpers/delete range by spec #369
Talpers/delete range by spec #369
Conversation
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? |
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 var query = ApplySpecification(specification);
_dbContext.Set<T>().RemoveRange(query); |
...Ardalis.Specification.EntityFrameworkCore.IntegrationTests/RepositoryOfT_DeleteRangeAsync.cs
Outdated
Show resolved
Hide resolved
Could you please update Nuget as well? :) |
New feature DeleteRange by specification