public async Task <IActionResult> Post([FromBody] PetDto model) { var pet = await _petsRepository.InsertPetAsync(AutoMapper.Mapper.Map <Pet>(model)); var petToReturn = AutoMapper.Mapper.Map <PetDto>(pet); petToReturn.PopulateLinks(_urlHelper); return(CreatedAtRoute("GetPetById", new { id = petToReturn.Id }, petToReturn)); }