您的位置:首页 > 其它

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

2014-10-22 17:11 260 查看
public interface IRepository<T> where T:class
{
//增加
T Add(T entity);
//更新
bool Update(T entity);
//删除
bool Delete(T entity);
//检查名字是否为空
bool CheckNameIsEmpty(Expression<Func<T, bool>> whereLambda);
//检查名字是否存在
bool CheckNameExist(Expression<Func<T, bool>> whereLambda);
//判断其他输入项是否都符合要求
bool Check(Expression<Func<T, bool>> whereLambda);
//保存
//void Save();
//统计
int Count(Expression<Func<T, bool>> predicate);
//强制类型转换列表
List<T> ToList();
//查找
T Find(Expression<Func<T, bool>> whereLambda);
//条件查找
IQueryable<T> FindList(Expression<Func<T, bool>> whereLamba, string orderName, bool isAsc);
//条件查找
IQueryable<T> FindList<S>(Expression<Func<T, bool>> whereLambda, bool isAsc,
Expression<Func<T, S>> orderLamba);
//条件查找

IQueryable<T> FindPageList<S>(int pageIndex, int pageSize, out int totalRecordCnt,
Expression<Func<T, bool>> whereLamdba, bool isAsc, Expression<Func<T, S>> orderLambda);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐