Ejemplo n.º 1
0
        public IEnumerable <string> Get()
        {
            var predictions       = NetworkLogic.JustTipFullSeason();
            var simplePredictions = SimplePrediction.Convert(predictions);
            var json = simplePredictions.Select(JsonConvert.SerializeObject);

            return(json);
        }
Ejemplo n.º 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);
        }