[ASP.NET Controller] No route matches the supplied values
I'm trying to redirect my call to get the animal information from the create action method using this
And this is my GetById Action method
And this is my GetById Action method
return CreatedAtAction(nameof(GetById), new { Id = animal.Id }, _mapper.Map<AnimalDTO>(animal));[HttpGet("{animalId}")]
public async Task<IActionResult> GetById(int animalId, CancellationToken cancellationToken = default)
{
var animal = await _animalRepository.FindByIdAsync(animalId, cancellationToken);
return animal != null ? Ok(_mapper.Map<AnimalDTO>(animal)) : NotFound("Unable to find the requested animal");
}