refactor(repository): add query parameter to IRepository.Where and constrain IRepository.Entity

- Updated `IRepository<TEntity>.Where()` to accept an `Expression<Func<TEntity, bool>>` for filtering.
- Added `where TEntity : IEntity` constraint to `IRepository.Entity<TEntity>()` method.
- No functional logic changes, only interface refactoring for stronger typing and query support.
This commit is contained in:
2025-09-11 18:30:38 +02:00
parent b181e1543f
commit be96bd0c07
2 changed files with 20 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ public interface IRepository<TEntity>
public Task<IEnumerable<TEntity>> CreateAsync(IEnumerable<TEntity> entities, CancellationToken cancel = default);
public IQueryable<TEntity> Where();
public IQueryable<TEntity> Where(Expression<Func<TEntity, bool>> expression);
public IQueryable<TEntity> Get();
@@ -34,5 +34,5 @@ public interface IRepository<TEntity>
public interface IRepository
{
public IRepository<TEntity> Entity<TEntity>();
public IRepository<TEntity> Entity<TEntity>() where TEntity : IEntity;
}