public async Task <IActionResult> GetMachinesByJob(int userId) { if (userId != int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value)) { return(Unauthorized()); } IEnumerable <Mach> directMachines = await _repo.GetMachinesByJob(userId); var machines = _mapper.Map <IEnumerable <MachForReturnDto> >(directMachines); return(Ok(machines)); }