示例#1
0
        public async Task Execute(string gameId, string player, int value, int multiplier)
        {
            var game = await _getGame.Execute(gameId).ConfigureAwait(false);

            game.DartThrow(player, value, multiplier);
            await _persistGame.Execute(game.MapToDataResource()).ConfigureAwait(false);
        }
示例#2
0
        public async Task <IActionResult> GetGameById(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "game")] HttpRequest req)
        {
            // get params
            string gameId = req.Query["game"];

            // create work
            async Task <GameModelResponse> GetGameAndMapToResponse()
            => (await _getGame.Execute(gameId).ConfigureAwait(false)).MapToResponse();

            // run
            return(await RunAsync <GameModelResponse>(GetGameAndMapToResponse()).ConfigureAwait(false));
        }