Ejemplo n.º 1
0
        public double GetBetType(EventsTable betType)
        {
            if (betType != null)
            {
                var currentGameBetSpreadAway = betType.PointSpreadAwayMoney;
                var currentGameBetSpreadHome = betType.PointSpreadHomeMoney;
                var currentGameBetTotalOver  = betType.TotalOverMoney;
                var currentGameBetTotalUnder = betType.TotalUnderMoney;

                foreach (EventsTable entry in _context.EventsTable)
                {
                    //narrow down record
                    if (entry.EventId == betType.EventId && entry.PointSpreadAwayMoney == betType.PointSpreadAwayMoney)
                    {
                        currentGameBetSpreadAway += entry.PointSpreadAwayMoney;
                        return(currentGameBetSpreadAway);
                    }
                    else if (entry.EventId == betType.EventId && entry.PointSpreadHomeMoney == betType.PointSpreadHomeMoney)
                    {
                        currentGameBetSpreadHome += entry.PointSpreadHomeMoney;
                        return(currentGameBetSpreadHome);
                    }
                    else if (entry.EventId == betType.EventId && entry.TotalOverMoney == betType.TotalOverMoney)
                    {
                        currentGameBetTotalOver += entry.TotalOverMoney;
                        return(currentGameBetTotalOver);
                    }
                    else if (entry.EventId == betType.EventId && entry.TotalUnderMoney == betType.TotalUnderMoney)
                    {
                        currentGameBetTotalUnder += entry.TotalUnderMoney;
                        return(currentGameBetTotalUnder);
                    }
                }
            }
            return(0);
        }
Ejemplo n.º 2
0
        public double CalculateTheProbabilty(EventsTable betType)
        {
            return(GetBetType(betType) / (GetBetType(betType) + 100) * 100);

            //return 100 / (GetBetType(betType) + 100) * 100;
        }