比如在UI层需要调用分页的方法,返回数据
我一般是这样写方法的public IList<User> GetList(int pageIndex,int pageSize,out int rowCount)这样是否有不妥之处,有什么好的方式呢,求解
我一般是这样写方法的public IList<User> GetList(int pageIndex,int pageSize,out int rowCount)这样是否有不妥之处,有什么好的方式呢,求解
IList<T> GetList(int pageIndex,int pageSize,out int rowCount)这样比较通用吧。
如果你换个类的话 这个接口就不能用了哦。
如果不要的话,那么调用方怎么知道总共记录数呢
你完全可以把int pageIndex,int pageSize,out int rowCount这些东西 做一个实体。。
我前面的项目就是这么做的。。
个人见解。。
public interface IBaseDAL<T> where T : BaseModel, new()
{
int Add(T model);
int Update(T model);
int Delete(T model);
。
}