Esempio n. 1
0
        public static Task WaterAnimal(
            [HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "game/{gameName}/water-animal")] WaterAnimalCommand command,
            [DurableClient] IDurableEntityClient client,
            string gameName)
        {
            var entityId = new EntityId(nameof(AnimalBehavior), $"{gameName}:{command.AnimalName}:{command.PlayerName}");

            return(client.SignalEntityAsync <IAnimalBehavior>(entityId, proxy => proxy.Water()));
        }
Esempio n. 2
0
        public Task WaterAnimalAsync(string gameName, string playerName, string animalName)
        {
            var command = new WaterAnimalCommand
            {
                PlayerName = playerName,
                AnimalName = animalName
            };

            return(_client.SendJsonAsync(HttpMethod.Post, $"/api/game/{gameName}/water-animal", command));
        }