-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIGenericRepositoryAsync.cs
More file actions
33 lines (21 loc) · 936 Bytes
/
Copy pathIGenericRepositoryAsync.cs
File metadata and controls
33 lines (21 loc) · 936 Bytes
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
using Ardalis.Specification;
namespace TalentManagementAPI.Application.Interfaces
{
/// <summary>
/// Interface for a generic repository that can handle CRUD operations and more on any entity of type T.
/// </summary>
public interface IGenericRepositoryAsync<T> where T : class
{
Task<T> GetByIdAsync(Guid id);
Task<IEnumerable<T>> GetAllAsync();
Task<T> AddAsync(T entity);
Task UpdateAsync(T entity);
Task DeleteAsync(T entity);
Task BulkInsertAsync(IEnumerable<T> entities);
Task<IEnumerable<T>> GetPagedReponseAsync(int pageNumber, int pageSize);
Task<IEnumerable<T>> GetAllShapeAsync(string orderBy, string fields);
Task<IReadOnlyList<T>> ListAsync(ISpecification<T> specification);
Task<T> FirstOrDefaultAsync(ISpecification<T> specification);
Task<int> CountAsync(ISpecification<T> specification);
}
}