Exemple #1
0
        public void AddGameResult(string order, int buyIn, bool winnerTakes)
        {
            List <int>         results    = new JavaScriptSerializer().Deserialize <List <int> >(order);
            List <PokerResult> resultsObj = new List <PokerResult>();

            PokerMatch match = new PokerMatch
            {
                Date             = DateTime.Now,
                IsWinnerTakesAll = winnerTakes,
                BuyIn            = buyIn
            };

            for (int i = 0; i < results.Count; i++)
            {
                resultsObj.Add(new PokerResult
                {
                    Placing      = i + 1,
                    PokerUserId  = results[i],
                    PokerMatchId = 0
                });
            }

            _pokerService.AddGameResult(match, resultsObj);
        }