public async Task <IActionResult> GetPartByJob(int userId, string job) { if (userId != int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value)) { return(Unauthorized()); } Part directPart = await _repo.GetPartByJob(userId, job); var part = _mapper.Map <PartForReturnDto>(directPart); return(Ok(part)); }