Files
PersonaCasa/back/Application/Contracts/Persistence/IAsyncRepository.cs
Alejandro Sarmiento b672887299 Primera subida
2024-04-06 03:32:16 +02:00

27 lines
1.3 KiB
C#

using back.Entities;
using System.Linq.Expressions;
namespace back.Application.Contracts.Persistence
{
public interface IAsyncRepository<T> where T : BaseEntity
{
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(int id);
Task<T> AddAsync(T entity);
Task<T> UpdateAsync(T entity);
Task DeleteAsync(T entity);
}
}