public async Task <PagedList <WorkShift> > GetWorkShiftByEmployeeIdAsync(WorkShiftParameters workShiftParameters) { IQueryable <WorkShift> result = FindByCondition(ws => ws.EmployeeId == workShiftParameters.EmployeeId); return(await PagedList <WorkShift> .ToPageList(result.OrderBy(ws => ws.ShiftId), workShiftParameters.PageNumber, workShiftParameters.PageSize)); }
public async Task <PagedList <WorkShift> > GetAllWorkShiftAsync(WorkShiftParameters workShiftParameters) { return(await PagedList <WorkShift> .ToPageList(FindAll().OrderBy(ws => ws.ShiftId), workShiftParameters.PageNumber, workShiftParameters.PageSize)); }
public async Task <ActionResult> GetWorkShiftsByEmployeeId([FromQuery] WorkShiftParameters workShiftParameters) { var workShift = await _repoWrapper.WorkShift.GetWorkShiftByEmployeeIdAsync(workShiftParameters); return(Ok(workShift)); }