示例#1
0
        public List <Bet> GetBetsFromUser(User user)
        {
            matchservice = new MatchService();

            List <Bet> betList = new List <Bet>();

            betList = betrep.GetBetsByUser(user);

            foreach (Bet bet in betList)
            {
                if (bet.HasEnded == true)
                {
                    bet.Match = matchservice.GetFinishedMatch(bet.MatchID);
                }
                else
                {
                    bet.Match = matchservice.GetUpcomingMatch(bet.MatchID);
                }
            }

            return(betList);
        }