1、遇到ajax请求出错,立马按下F12==>Network
2、(一个听脑残的bug,也不能说是bug,因为程序并没有报错)代码如下:
public HouseAppointmentDTO[] GetPagedData(long cityId,string status,int pageSize,int currentIndex) { using (ZSZDbContext ctx = new ZSZDbContext()) { BaseService<HouseAppointmentEntity> bs = new BaseService<HouseAppointmentEntity>(ctx); var apps = bs.GetAll().Include(a => a.House) .Include(nameof(HouseAppointmentEntity.House) + "." + nameof(HouseEntity.Community) + "." + nameof(CommunityEntity.Region)) .AsNoTracking() .Where(a => a.House.Community.Region.CityId == cityId && a.Status == status) .OrderByDescending(a => a.CreateDateTime); .Skip(currentIndex).Take(pageSize); return apps.ToList().Select(a => ToDTO(a)).ToArray(); } }
然而我插入数据库的记录只有一条,那还take个毛啊!!!