Esempio n. 1
0
        public async Task <LiveResultViewModel> ChangeResult(string buttonId, int matchId)
        {
            LiveResultViewModel result = null;

            if (buttonId.Equals("firstButtonId"))
            {
                result = await matchService.AddFirstPlayerPoint(matchId);
            }

            if (buttonId.Equals("secondButtonId"))
            {
                result = await matchService.AddSecondPlayerPoint(matchId);
            }

            var newResult = mapper.Map <LiveMatchResultViewModel>(result);

            await sportHub.Clients.All.SendAsync("NewResult", newResult);

            return(result);
        }