Beispiel #1
0
        private static void AddUserBetToListForGroup(TodaysGamesSpecification todaysGamesSpecification,
                                                     Bet currentGamesBet, UserBetViewModel userBetViewModel)
        {
            var resultAsString = currentGamesBet.HomeGoals + "-" + currentGamesBet.AwayGoals;

            AddOrUpdateTodaysBet(todaysGamesSpecification, resultAsString, userBetViewModel);
        }
Beispiel #2
0
 private static void AddUserBetToExistingResult(TodaysGamesSpecification todaysGamesSpecification, string teamKey,
                                                UserBetViewModel userBetViewModel)
 {
     todaysGamesSpecification.Bets
     .Where(x => x.Result == teamKey)
     .ToList()
     .ForEach(s => s.UserBets.Add(userBetViewModel));
 }
Beispiel #3
0
        private static void SetValuesFromBetForPlayoffGame(TodaysGamesSpecification todaysGamesSpecification, Team team,
                                                           string userNameForUserBet)
        {
            var teamKey          = team.Name + " videre";
            var userBetViewModel = new UserBetViewModel {
                UserName = userNameForUserBet
            };

            AddOrUpdateTodaysBet(todaysGamesSpecification, teamKey, userBetViewModel);
        }
Beispiel #4
0
        private static void AddNewTodaysBet(TodaysGamesSpecification todaysGamesSpecification, string teamKey,
                                            UserBetViewModel userBetViewModel)
        {
            var todaysBets = new TodaysBet {
                Result = teamKey, UserBets = new List <UserBetViewModel> {
                    userBetViewModel
                }
            };

            todaysGamesSpecification.Bets.Add(todaysBets);
        }
Beispiel #5
0
 private static void AddOrUpdateTodaysBet(TodaysGamesSpecification todaysGamesSpecification, string teamKey,
                                          UserBetViewModel userBetViewModel)
 {
     if (todaysGamesSpecification.Bets.Any(x => x.Result == teamKey))
     {
         AddUserBetToExistingResult(todaysGamesSpecification, teamKey, userBetViewModel);
     }
     else
     {
         AddNewTodaysBet(todaysGamesSpecification, teamKey, userBetViewModel);
     }
 }