private void UpdateScores(MatchResultUpdateModel[] updates, ICompetitionsManager manager)
        {
            var matchScoreUpdateInfoItems = new List <MatchScoreUpdateInfo>();

            updates.ForEach(update =>
            {
                var matchScoreUpdateInfo = new MatchScoreUpdateInfo();

                matchScoreUpdateInfo.MatchId = update.Id;
                matchScoreUpdateInfo.Result  = update.Result;
                matchScoreUpdateInfo.Winner  = update.Winner;

                matchScoreUpdateInfoItems.Add(matchScoreUpdateInfo);
                if (update.SetScores.NotNullOrEmpty())
                {
                    var scores =
                        update.SetScores.Where(s => !(s.Player1Points == 0 && s.Player2Points == 0));
                    if (scores.NotNullOrEmpty())
                    {
                        matchScoreUpdateInfo.SetScores = update.SetScores;
                    }
                }
            });
            if (matchScoreUpdateInfoItems.NotNullOrEmpty())
            {
                manager.UpdateMatchScore(matchScoreUpdateInfoItems.ToArray());
            }
        }
        private void UpdateStartTimes(MatchResultUpdateModel[] updates, ICompetitionsManager manager)
        {
            var dateUpdates =
                updates.Where(
                    up =>
                    (up.StartTimeHours.HasValue || up.StartTimeMinutes.HasValue || up.StartTimeType.HasValue) &&
                    up.Date.NotNullOrEmpty());

            var startTimeUpdates =
                dateUpdates.Select(
                    dateUpdate =>
            {
                var startTimeUpdateInfo       = new MatchStartTimeUpdateInfo();
                startTimeUpdateInfo.MatchId   = dateUpdate.Id;
                startTimeUpdateInfo.StartTime = BuildStartTime(dateUpdate.Date, dateUpdate.StartTimeHours,
                                                               dateUpdate.StartTimeMinutes);
                if (dateUpdate.StartTimeType.HasValue)
                {
                    startTimeUpdateInfo.StartTimeType = dateUpdate.StartTimeType.Value;
                }

                return(startTimeUpdateInfo);
            });

            manager.UpdateMatchStartTime(startTimeUpdates.ToArray());
        }
        private void UpdateStartTimes(MatchResultUpdateModel[] updates, ICompetitionsManager manager)
        {
            var dateUpdates =
            updates.Where(
                up =>
                (up.StartTimeHours.HasValue || up.StartTimeMinutes.HasValue || up.StartTimeType.HasValue) &&
                up.Date.NotNullOrEmpty());
            
            var startTimeUpdates =
            dateUpdates.Select(
                dateUpdate =>
                {
                    var startTimeUpdateInfo = new MatchStartTimeUpdateInfo();
                    startTimeUpdateInfo.MatchId = dateUpdate.Id;
                    startTimeUpdateInfo.StartTime = BuildStartTime(dateUpdate.Date, dateUpdate.StartTimeHours,
                                                                   dateUpdate.StartTimeMinutes);
                    if (dateUpdate.StartTimeType.HasValue)
                    {
                        startTimeUpdateInfo.StartTimeType = dateUpdate.StartTimeType.Value;
                    }

                    return startTimeUpdateInfo;
                });

            manager.UpdateMatchStartTime(startTimeUpdates.ToArray());
        }
        private void UpdateScores(MatchResultUpdateModel[] updates, ICompetitionsManager manager)
        {
            var matchScoreUpdateInfoItems = new List<MatchScoreUpdateInfo>();
            updates.ForEach(update =>
                                {
                                    var matchScoreUpdateInfo = new MatchScoreUpdateInfo();

                                    matchScoreUpdateInfo.MatchId = update.Id;
                                    matchScoreUpdateInfo.Result = update.Result;
                                    matchScoreUpdateInfo.Winner = update.Winner;

                                    matchScoreUpdateInfoItems.Add(matchScoreUpdateInfo);
                                    if (update.SetScores.NotNullOrEmpty())
                                    {
                                        var scores =
                                            update.SetScores.Where(s => !(s.Player1Points == 0 && s.Player2Points == 0));
                                        if (scores.NotNullOrEmpty())
                                        {
                                            matchScoreUpdateInfo.SetScores = update.SetScores;
                                        }
                                    }
                                });
            if (matchScoreUpdateInfoItems.NotNullOrEmpty())
            {
                manager.UpdateMatchScore(matchScoreUpdateInfoItems.ToArray());
            }
        }