-
Notifications
You must be signed in to change notification settings - Fork 255
Closed
Description
Hi, Ardalis Specification is a really great project that I use extensively as Nuget. I have an additional feature request. I have implemented in my own EfRepository, but would like to see in your project. It is about deleting entities per specification.
The existing way is to list entities and then delete them.
public abstract class RepositoryBase<T> : IReadRepository<T> where T : class
{
...
public virtual async Task DeleteRangeAsync(ISpecification<T> specification, CancellationToken cancellationToken = default)
{
var query = ApplySpecification(specification);
_dbContext.Set<T>().RemoveRange(query);
await SaveChangesAsync(cancellationToken);
}
...
}
I could also create a PR with unittests.
Metadata
Metadata
Assignees
Labels
No labels