public IActionResult DeleteDogInformation(int clientId, int id) { if (!_clientInfoRepository.ClientExists(clientId)) { return(NotFound()); } var dogEntity = _clientInfoRepository .GetDogForClient(clientId, id); if (dogEntity == null) { return(NotFound()); } _clientInfoRepository.DeleteDogInformation(dogEntity); _clientInfoRepository.Save(); return(NoContent()); }