refactor(IRepository): rename Read/ReadOnly to Where/Get and mark as obsolete
- Replaced `Read()` with `Where()` and `ReadOnly()` with `Get()` in `IRepository<TEntity>` - Marked `Read()` and `ReadOnly()` as `[Obsolete]` with guidance for the new methods - Added non-generic `IRepository` interface with `Entity<TEntity>()` method
This commit is contained in:
parent
513f8c1ba3
commit
ce8e563e4e
@ -10,9 +10,9 @@ public interface IRepository<TEntity>
|
||||
|
||||
public Task<IEnumerable<TEntity>> CreateAsync(IEnumerable<TEntity> entities, CancellationToken cancel = default);
|
||||
|
||||
public IQueryable<TEntity> Read();
|
||||
public IQueryable<TEntity> Where();
|
||||
|
||||
public IQueryable<TEntity> ReadOnly();
|
||||
public IQueryable<TEntity> Get();
|
||||
|
||||
public Task UpdateAsync<TDto>(TDto dto, Expression<Func<TEntity, bool>> expression, CancellationToken cancel = default);
|
||||
|
||||
@ -21,4 +21,17 @@ public interface IRepository<TEntity>
|
||||
public Task DeleteAsync(Expression<Func<TEntity, bool>> expression, CancellationToken cancel = default);
|
||||
|
||||
public Task DeleteAsync(Func<IQueryable<TEntity>, IQueryable<TEntity>> query, CancellationToken cancel = default);
|
||||
|
||||
#region Obsolete
|
||||
[Obsolete("Use IRepository<TEntity>.Where")]
|
||||
public IQueryable<TEntity> Read();
|
||||
|
||||
[Obsolete("Use IRepository<TEntity>.Get")]
|
||||
public IQueryable<TEntity> ReadOnly();
|
||||
#endregion
|
||||
}
|
||||
|
||||
public interface IRepository
|
||||
{
|
||||
public IRepository<TEntity> Entity<TEntity>();
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user