public async Task <IActionResult> GetAllPartsByType(int userId, string machType) { if (userId != int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value)) { return(Unauthorized()); } IEnumerable <Part> directParts = await _repo.GetAllParts(userId, machType); var parts = _mapper.Map <IEnumerable <PartForReturnDto> >(directParts); return(Ok(parts)); }