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