Skip to content

Commit

Permalink
Adding DeleteWhereAsync to the IRepository interface
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanHair committed Sep 21, 2023
1 parent 4401cf2 commit 7efccb5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Interfaces/IRepository.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;

Expand Down Expand Up @@ -56,6 +57,13 @@ public interface IRepository<T> : IReadOnlyRepository<T>
/// <returns>A <see cref="Task"/> representing the work of deleting</returns>
Task DeleteAsync(T entity, CancellationToken cancellationToken = default);

/// <summary>
/// Deletes a set of entities satisfying a provided expression
/// </summary>
/// <param name="predicate">The expression to filter the entities</param>
/// <returns>A <see cref="Task"/> representing the work of deleting</returns>
Task DeleteWhereAsync(Expression<Func<T, bool>> predicate, CancellationToken cancellationToken = default);

/// <summary>
/// Simply saves any changes to all currently tracked entities without needing
/// to pass in a entity.
Expand Down

0 comments on commit 7efccb5

Please sign in to comment.