IRepository.cs 649 B

12345678910111213141516171819202122232425
  1. using SnapshotWinFormsApp.Entities.NewHotline;
  2. using SqlSugar;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace SnapshotWinFormsApp.Repository.Interfaces;
  9. public interface IRepository<T> where T : class, new()
  10. {
  11. ISugarQueryable<T> Queryable();
  12. T GetById(int id);
  13. List<T> GetAll();
  14. }
  15. public interface IBaseRepository<T> where T : Entity, new()
  16. {
  17. ISugarQueryable<T> Queryable();
  18. T GetById(int id);
  19. Task<List<T>> GetAllAsync(CancellationToken token);
  20. Task<string> InsertAsync(T entity, CancellationToken token);
  21. void Update(T entity);
  22. }