首页 > Web开发 > 详细

不成功的MVC Repository模式,记录下来,后面看看原因在哪里(一) IRepository类

时间:2014-10-22 19:47:30      阅读:639      评论:0      收藏:0      [点我收藏+]
 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     }

 

不成功的MVC Repository模式,记录下来,后面看看原因在哪里(一) IRepository类

原文:http://www.cnblogs.com/minglilee2012/p/4043762.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!