This is my DAL method:
这是我的DAL方法:
public List<Schedule> GetSchedulesWithProfiles(int displayStart, int displayLength, out int allDataCount, out int filteredDatacount, string searchParam = "", string searchDir = "")
{
using (var context = new ApplicationDbContext())
{
var schedules = context.Schedules.Include(x => x.Profile).Include(x => x.VacationType);
allDataCount = schedules.Count();
if (!string.IsNullOrEmpty(searchParam))
{
schedules = schedules.Where(c => c.Data.Contains(searchParam));
}
filteredDatacount = schedules.Count();
if (searchDir == "asc" || String.IsNullOrEmpty(searchDir))
schedules = schedules.OrderBy(x => x.Data).Skip(displayStart).Take(displayLength);
else
schedules = schedules.OrderByDescending(x => x.Data).Skip(displayStart).Take(displayLength);
return schedules.ToList();
}
}
public Li