public async Task <ActionResult <IReadOnlyList <LeaveDto> > > GetLeaves(int tenantId) { var filter = new LeavesFilter { InmateId = tenantId }; var spec = new LeaveWithInmateSpecification(filter); return(Ok(await _unitOfWork.Repository <Leave>().FindAllBySpecAsync <LeaveDto>(spec))); }
public async Task <ActionResult <LeaveDto> > GetLeave(int id) { var filter = new LeavesFilter { LeaveId = id }; var spec = new LeaveWithInmateSpecification(filter); return(await _unitOfWork.Repository <Leave>().FindOneBySpecAsync <LeaveDto>(spec)); }