using FineAdmin.Model; using System; using System.Collections.Generic; namespace FineAdmin.IRepository { public interface IBaseRepository where T : class, new() { #region CRUD /// /// 根据主键返回实体 /// T GetById(int Id); /// /// 新增 /// int Insert(T model); /// /// 根据主键修改数据 /// int UpdateById(T model); /// /// 根据主键修改数据 修改指定字段 /// int UpdateById(T model, string updateFields); /// /// 根据主键删除数据 /// int DeleteById(int Id); /// /// 根据主键批量删除数据 /// int DeleteByIds(object Ids); /// /// 根据条件删除 /// int DeleteByWhere(string where); #endregion /// /// 获取分页数据 /// IEnumerable GetByPage(SearchFilter filter, out int total); /// /// 获取分页数据 联合查询 /// IEnumerable GetByPageUnite(SearchFilter filter, out int total); /// /// 返回整张表数据 /// returnFields需要返回的列,用逗号隔开。默认null,返回所有列 /// IEnumerable GetAll(string returnFields = null, string orderby = null); /// /// 根据查询条件获取数据 /// IEnumerable GetByWhere(string where = null, object param = null, string returnFields = null, string orderby = null); } }