IAbstractRepository.cs 517 B

1234567891011121314151617181920
  1. using System.Linq.Expressions;
  2. using Domain;
  3. namespace DataLayer.Interfaces;
  4. public interface IAbstractRepository<T> where T : BaseEntity
  5. {
  6. Task<T> GetById(int id);
  7. Task<T> FirstOrDefault(Expression<Func<T, bool>> predicate);
  8. Task Add(T entity);
  9. Task Update(T entity);
  10. Task Remove(T entity);
  11. Task<IEnumerable<T>> GetAll();
  12. Task<IEnumerable<T>> GetWhere(Expression<Func<T, bool>> predicate);
  13. Task<int> CountAll();
  14. Task<int> CountWhere(Expression<Func<T, bool>> predicate);
  15. }