refactor(Repository): add Query getter metod to Repository calss and interface to be able to create read-only query without expression
This commit is contained in:
@@ -73,6 +73,8 @@ public class DbRepository<TDbContext, TEntity> : IRepository<TEntity> where TDbC
|
||||
#endregion Create
|
||||
|
||||
#region Read
|
||||
public virtual IQueryable<TEntity> Query => Entities.AsNoTracking();
|
||||
|
||||
public virtual IQueryable<TEntity> Where(Expression<Func<TEntity, bool>> expression) => Entities.AsNoTracking().Where(expression);
|
||||
|
||||
public virtual IEnumerable<TEntity> GetAll() => Entities.AsNoTracking().ToList();
|
||||
|
||||
Reference in New Issue
Block a user