1、接口(IBaseRepository(仓储))操作数据库(增删改查),代码如下:
/// <summary> /// 基仓储实现的方法 /// </summary> /// <typeparam name="T"></typeparam> public interface IBaseRepository<T> where T : class,new() { //添加 T AddEntities(T entity); //修改 bool UpdateEntities(T entity); //删除 bool DeleteEntities(T entity); //查询 IQueryable<T> LodeEntities(Func<T, bool> wherelambda); //分页 IQueryable<T> LoadPagerEntities<S>(int pageSize, int pageIndex, out int total, Func<T, bool> wherelambda, bool isAsc, Func<T, S> orderByLambda); }
时间: 2024-10-12 20:17:53