zoukankan      html  css  js  c++  java
  • 不成功的MVC Repository模式,记录下来,后面看看原因在哪里(一) IRepository类

     1  public interface IRepository<T> where T:class
     2     {
     3         //增加
     4         T Add(T entity);
     5         //更新
     6         bool Update(T entity);
     7         //删除
     8         bool Delete(T entity);
     9         //检查名字是否为空
    10         bool CheckNameIsEmpty(Expression<Func<T, bool>> whereLambda);
    11         //检查名字是否存在
    12         bool CheckNameExist(Expression<Func<T, bool>> whereLambda);
    13         //判断其他输入项是否都符合要求
    14         bool Check(Expression<Func<T, bool>> whereLambda);
    15         //保存
    16         //void Save();
    17         //统计
    18         int Count(Expression<Func<T, bool>> predicate);
    19         //强制类型转换列表
    20         List<T> ToList();
    21         //查找
    22         T Find(Expression<Func<T, bool>> whereLambda);
    23         //条件查找
    24         IQueryable<T> FindList(Expression<Func<T, bool>> whereLamba, string orderName, bool isAsc);
    25         //条件查找
    26         IQueryable<T> FindList<S>(Expression<Func<T, bool>> whereLambda, bool isAsc,
    27             Expression<Func<T, S>> orderLamba);
    28         //条件查找
    29 
    30         IQueryable<T> FindPageList<S>(int pageIndex, int pageSize, out int totalRecordCnt,
    31             Expression<Func<T, bool>> whereLamdba, bool isAsc, Expression<Func<T, S>> orderLambda);
    32 
    33     }
  • 相关阅读:
    Mysql InnoDB引擎下 事务的隔离级别
    Spring 两大核心 IOC 和 AOP
    java 冒泡排序
    MyBatis 传入List集合作为条件查询数据
    fastfusion运行
    数据集
    工具学习
    三维重建
    Scrivener破解
    博客园设置
  • 原文地址:https://www.cnblogs.com/minglilee2012/p/4043762.html
Copyright © 2011-2022 走看看