Beispiel #1
0
        // GET api/values
        public string Get()
        {
            var predictions       = NetworkLogic.JustTipFullSeason();
            var simplePredictions = SimplePrediction.Convert(predictions);

            return(simplePredictions.ToJson());
        }
Beispiel #2
0
        public static List <SimplePrediction> Convert(List <PredictedMatch> predictedMatches)
        {
            var simplePredictions = new List <SimplePrediction>();

            foreach (var predictedMatch in predictedMatches)
            {
                var simplePrediction = new SimplePrediction()
                {
                    Home        = predictedMatch.Home.Region,
                    Away        = predictedMatch.Away.Region,
                    Ground      = predictedMatch.Ground.Names.First(),
                    Date        = predictedMatch.Date,
                    HomeTotal   = predictedMatch.HomeTotal,
                    AwayTotal   = predictedMatch.AwayTotal,
                    Year        = predictedMatch.Date.Year,
                    RoundNumber = predictedMatch.RoundNumber
                };
                simplePredictions.Add(simplePrediction);
            }

            return(simplePredictions);
        }