Object null when using the same action controller

I have my GetById Action controller giving the result like this when request directly from it notice that the Breed not null (the first image)
[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"); 
        }

And I have the Create Action Controller which basically using the GetById to give me the animal using the below return
return CreatedAtAction(nameof(GetById), new { Id = animal.Id }, _mapper.Map<AnimalDTO>(animal));

And the second picture is the result I got which is the breed completely null
unknown.png
unknown.png
Was this page helpful?