feat(repository): add GetAll and GetAllAsync methods to IRepository
- Introduced GetAll() and GetAllAsync() to provide full entity retrieval options. - Updated obsolete warnings: - Read() now marked with "Use CreateAsync, UpdateAsync or DeleteAsync". - ReadOnly() points to IRepository<TEntity>.Where. - Removed old Get() method in favor of new retrieval methods.
This commit is contained in:
@@ -13,7 +13,9 @@ public interface IRepository<TEntity>
|
||||
|
||||
public IQueryable<TEntity> Where(Expression<Func<TEntity, bool>> expression);
|
||||
|
||||
public IQueryable<TEntity> Get();
|
||||
public IEnumerable<TEntity> GetAll();
|
||||
|
||||
public Task<IEnumerable<TEntity>> GetAllAsync();
|
||||
|
||||
public Task UpdateAsync<TDto>(TDto dto, Expression<Func<TEntity, bool>> expression, CancellationToken cancel = default);
|
||||
|
||||
@@ -24,10 +26,10 @@ public interface IRepository<TEntity>
|
||||
public Task DeleteAsync(Func<IQueryable<TEntity>, IQueryable<TEntity>> query, CancellationToken cancel = default);
|
||||
|
||||
#region Obsolete
|
||||
[Obsolete("Use IRepository<TEntity>.Where")]
|
||||
[Obsolete("Use CreateAsync, UpdateAsync or DeleteAsync")]
|
||||
public IQueryable<TEntity> Read();
|
||||
|
||||
[Obsolete("Use IRepository<TEntity>.Get")]
|
||||
[Obsolete("Use IRepository<TEntity>.Where")]
|
||||
public IQueryable<TEntity> ReadOnly();
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user