public void PopulateDetailsForMatch(Match match)
        {
            var matchDetails = _steamApi.TryGetMatchDetails(match.match_id);

            if (matchDetails != null)
            {
                _matchRepository.AddMatch(matchDetails);
            }
        }
Beispiel #2
0
        public void CreateMatch(MatchModel match)
        {
            using (var repository = new MatchRepository())
            {
                var matchDbModel = new Match
                {
                    MatchHomeTeamName = match.HomeTeamName,
                    MatchAwayTeamName = match.AwayTeamName,
                    MatchAwayTeamId   = match.SelectedAwayTeamId,
                    MatchHomeTeamId   = match.SelectedHomeTeamId,
                    MatchKickOff      = match.KickOff,
                };

                repository.AddMatch(matchDbModel);
            }
        }
Beispiel #3
0
        //create
        public void CreateMatch(MatchViewModel match)
        {
            using (var repository = new MatchRepository())
            {
                var matchDbModel = new Match
                {
                    Id         = match.Id,
                    Date       = match.Date,
                    Time       = match.Time,
                    TeamAScore = match.TeamAScore,
                    TeamBScore = match.TeamBScore,
                    TeamAId    = match.ViewTeamAId,
                    TeamBId    = match.ViewTeamBId
                };

                repository.AddMatch(matchDbModel);
            }
        }
Beispiel #4
0
        private void MatchEndedTableEvent(Match obj)
        {
            obj.Id = Guid.NewGuid();
            var match = new Match
            {
                Id     = obj.Id,
                Scores = obj.Scores,
                Table  = _tableBusinessModel.FindTableByName(obj.Table.Name)
            };

            match.TableId = match.Table.Id;
            match.Status  = obj.Status;
            _matchRepository.AddMatch(match);
            if (obj.Status == MatchStatus.Ended)
            {
                EventAggregator.Resolve <TopTenChanged>().Publish(GetTopTen());
            }
        }