forked from SharpRepository/SharpRepository
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIRepositoryBase.cs
More file actions
36 lines (32 loc) · 1.24 KB
/
Copy pathIRepositoryBase.cs
File metadata and controls
36 lines (32 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using SharpRepository.Repository.Specifications;
using SharpRepository.Repository.Traits;
namespace SharpRepository.Repository
{
// TODO: I want to use the ICanDelete<> trait so that they aren't defined in 2 places but I can't because the Delete(TKey) can't be in RepositoryBase because it can't be in the CompoundKeyRepository
public interface IRepositoryBase<T> : ICanAdd<T>, ICanUpdate<T>, ICanBatch<T> where T : class
{
/// <summary>
/// Deletes the specified entity.
/// </summary>
/// <param name="entity">The entity.</param>
void Delete(T entity);
/// <summary>
/// Deletes the specified entities.
/// </summary>
/// <param name="entities">The entities.</param>
void Delete(IEnumerable<T> entities);
/// <summary>
/// Deletes all matching entities
/// </summary>
/// <param name="predicate">Query</param>
void Delete(Expression<Func<T, bool>> predicate);
/// <summary>
/// Deletes all matching entities
/// </summary>
/// <param name="criteria">Query</param>
void Delete(ISpecification<T> criteria);
}
}