Files
CleanArchitecture/CleanArchitecture/CleanArchitecture.Application/Contracts/Persistence/IAsyncRepository.cs
Alejandro Sarmiento 81a3e91d6e Video 76
Se hizo toda la parte del Unit Of Work y estoy a punto de terminar la de tests unitarios
2024-02-28 22:40:34 +01:00

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);
}
}