123456789101112131415161718192021222324252627282930313233 |
- using SnapshotWinFormsApp.Entities.NewHotline;
- using SnapshotWinFormsApp.Entities.OldHotline;
- using SqlSugar;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SnapshotWinFormsApp.Repository.Interfaces;
- public interface IRepository<T, TKey> where T : OldBaseEntity<TKey>, new()
- {
- ISugarQueryable<T> Queryable();
- T GetById(int id);
- Task<List<T>> GetAllAsync(CancellationToken token);
- DataTable GetDataTable(string sql, List<SugarParameter> parameters = null);
- }
- public interface IBaseRepository<T> where T : Entity, new()
- {
- SqlSugarClient db { get; }
- ISugarQueryable<T> Queryable();
- T GetById(int id);
- Task<List<T>> GetAllAsync(CancellationToken token);
- Task<string> InsertAsync(T entity, CancellationToken token);
- string InsertBulk(T entity, bool isEnd);
- void Update(T entity);
- IUpdateable<T> Updateable();
- Task<int> ExecuteSqlAsync(string sql);
- DataTable GetDataTable(string sql);
- }
|