public async Task <ActionResult <SquadGetIdDto> > GetSquad(int Id) { try { var result = await _squadRepository.GetSquadAsync(Id); var resultDto = _mapper.Map <SquadGetIdDto>(result); if (result == null) { return(NotFound()); } return(Ok(resultDto)); } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError, "Erorr retrieving data from the database")); } }