using System.Linq.Expressions;
namespace LctMonolith.Infrastructure.Repositories;
///
/// Generic repository abstraction for aggregate root / entity access. Read operations return IQueryable for composition.
///
public interface IGenericRepository where TEntity : class
{
IQueryable Query(
Expression>? filter = null,
Func, IOrderedQueryable>? orderBy = null,
params Expression>[] includes);
Task GetByIdAsync(object id);
ValueTask FindAsync(params object[] keyValues);
Task AddAsync(TEntity entity, CancellationToken ct = default);
Task AddRangeAsync(IEnumerable entities, CancellationToken ct = default);
void Update(TEntity entity);
void Remove(TEntity entity);
Task RemoveByIdAsync(object id, CancellationToken ct = default);
}