123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using DataTransmission.Entity;
- using Hotline.Settings;
- 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;
- /// <summary>
- /// 操作老系统的仓储
- /// </summary>
- /// <typeparam name="T"></typeparam>
- /// <typeparam name="TKey"></typeparam>
- public interface ISourceRepository<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);
- }
- /// <summary>
- /// 操作新系统, 但是不需要插入数据的仓储
- /// </summary>
- /// <typeparam name="T"></typeparam>
- public interface ISelectRepository<T> where T : DataTransmission.Entity.Entity, new()
- {
- ISugarQueryable<T> Queryable();
- T GetById(string id);
- Task<List<T>> GetAllAsync(CancellationToken token);
- IList<T> GetAll();
- }
- /// <summary>
- /// 操作新系统插入的仓储
- /// </summary>
- /// <typeparam name="T"></typeparam>
- public interface ITargetRepository<T> where T : OldIdEntity, new()
- {
- SqlSugarClient db { get; }
- ISugarQueryable<T> Queryable();
- T GetById(int id);
- Task<IList<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);
- IList<T> GetAll();
- }
|