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