30 lines
1.4 KiB
C#
30 lines
1.4 KiB
C#
using CleanArchitecture.Domain.Common;
|
|
using System.Linq.Expressions;
|
|
|
|
namespace CleanArchitecture.Application.Contracts.Persistence
|
|
{
|
|
public interface IAsyncRepository<T> where T: BaseDomainModel
|
|
{
|
|
Task<IReadOnlyList<T>> GetAllAsync();
|
|
Task<IReadOnlyList<T>> GetAsync(Expression<Func<T, bool>>? predicate);
|
|
Task<IReadOnlyList<T>> GetAsync(Expression<Func<T, bool>>? predicate = null,
|
|
Func<IQueryable<T>, IOrderedQueryable<T>>? orderBy = null,
|
|
string includeString = null,
|
|
bool disableTracking = true);
|
|
Task<IReadOnlyList<T>> GetAsync(Expression<Func<T,bool>>? predicate = null,
|
|
Func<IQueryable<T>, IOrderedQueryable<T>>? orderBy = null,
|
|
List<Expression<Func<T, object>>>? includes = null,
|
|
bool disableTracking = true);
|
|
Task<T> GetByIdAsync(Guid id);
|
|
|
|
Task<T> AddAsync(T entity);
|
|
Task<T> UpdateAsync(T entity);
|
|
Task DeleteAsync(T entity);
|
|
|
|
void AddEntity(T entity);
|
|
void UpdateEntity(T entity);
|
|
void DeleteEntity(T entity);
|
|
|
|
}
|
|
}
|