小白师兄
public partial class CartDal { public int GetPageCount(int pageSize) { int recordCount = this.Dbsession.BooksDal.LoadEntities(c => true).Count(); return Convert.ToInt32((Math.Ceiling((double)recordCount / pageSize))); } } public partial class CartDal { public int GetPageCount(int pageSize,index){ return Convert.ToInt32((Math.Ceiling((double)pageSize * index))); } }