コード例 #1
0
        public async Task <IActionResult> Post([FromBody] NewAnimalDto newAnimal)
        {
            AnimalListItemDto createdAnimal = await _animalService.Create(newAnimal);

            var animalUri = CreateResourceUri(createdAnimal.Id);

            return(Created(animalUri, createdAnimal));
        }
コード例 #2
0
 public async Task SendCreatedAnimal(AnimalListItemDto animal)
 {
     await Clients.Others.SendAsync("ReceiveCreatedAnimal", animal);
 }