sort เรียงจากวันที่สร้าง

This commit is contained in:
Bright 2024-11-27 17:38:02 +07:00
parent 93d0c2711f
commit eb5de77b2d

View file

@ -106,7 +106,7 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
var data_search = (from x in _context.DisciplineComplaint_Appeals
where x.Title.Contains(keyword) ||
x.Description.Contains(keyword) ||
//x.Description.Contains(keyword) ||
x.CaseType.Contains(keyword) ||
x.CaseNumber.Contains(keyword) ||
x.Fullname.Contains(keyword) ||
@ -134,8 +134,9 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
CitizenId = x.CitizenId,
ProfileId = x.ProfileId,
LastUpdatedAt = x.LastUpdatedAt,
CreatedAt = x.CreatedAt
})
.OrderByDescending(x => x.LastUpdatedAt)
.OrderByDescending(x => x.CreatedAt)
.Skip((page - 1) * pageSize)
.Take(pageSize)
.ToList();