public IActionResult ListData_Substitution(IDataTablesRequest request, CourtLawUnitSubstitutionFilter filter) { var data = service.CourtLawUnitSubstitution_Select(filter); return(request.GetResponse(data)); }
public IQueryable <CourtLawUnitSubstitutionVM> CourtLawUnitSubstitution_Select(CourtLawUnitSubstitutionFilter filter) { return(repo.AllReadonly <CourtLawUnitSubstitution>() .Include(x => x.LawUnit) .Include(x => x.SubstituteLawUnit) .Where(x => x.CourtId == userContext.CourtId) .Where(x => x.DateFrom <= (filter.DateTo ?? DateTime.MaxValue)) .Where(x => x.DateTo >= (filter.DateFrom ?? DateTime.MinValue)) .Where(FilterExpireInfo <CourtLawUnitSubstitution>(false)) .OrderByDescending(x => x.DateFrom) .ProjectTo <CourtLawUnitSubstitutionVM>(CourtLawUnitSubstitutionVM.GetMapping()) .AsQueryable()); }