IRepository.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // ======================================
  2. // Author: Ebenezer Monney
  3. // Email: info@ebenmonney.com
  4. // Copyright (c) 2017 www.ebenmonney.com
  5. //
  6. // ==> Gun4Hire: contact@ebenmonney.com
  7. // ======================================
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Linq.Expressions;
  12. using System.Text;
  13. using System.Threading.Tasks;
  14. namespace DAL.Repositories.Interfaces
  15. {
  16. public interface IRepository<TEntity> where TEntity : class
  17. {
  18. void Add(TEntity entity);
  19. void AddRange(IEnumerable<TEntity> entities);
  20. void Update(TEntity entity);
  21. void UpdateRange(IEnumerable<TEntity> entities);
  22. void Remove(TEntity entity);
  23. void RemoveRange(IEnumerable<TEntity> entities);
  24. int Count();
  25. IEnumerable<TEntity> Find(Expression<Func<TEntity, bool>> predicate);
  26. TEntity GetSingleOrDefault(Expression<Func<TEntity, bool>> predicate);
  27. TEntity Get(int id);
  28. IEnumerable<TEntity> GetAll();
  29. }
  30. }