Пример #1
0
        private Column AsFootballItem(Livescore match)
        {
            var submitActionData = JObject.Parse("{ \"Type\": \"MatchSelection\" }");

            submitActionData.Merge(JObject.FromObject(match));

            return(new Column()
            {
                Size = "20",
                Items = new List <CardElement>()
                {
                    new TextBlock()
                    {
                        Text = match.Name,
                        Speak = $"<s>{match.Name}</s>",
                        HorizontalAlignment = HorizontalAlignment.Center,
                        Wrap = false,
                        Weight = TextWeight.Bolder
                    },
                    new Image()
                    {
                        Size = ImageSize.Auto,
                        Url = match.Image
                    }
                },
                SelectAction = new SubmitAction()
                {
                    DataJson = submitActionData.ToString()
                }
            });
        }
Пример #2
0
        private IEnumerable <Livescore> GetLivescore(FootballQuery searchQuery)
        {
            var livescore = new List <Livescore>();

            for (int i = 1; i <= 2; i++)
            {
                if (i == 1)
                {
                    Livescore match = new Livescore()
                    {
                        Name   = $"Match No. {i}",
                        Team1  = searchQuery.Team1,
                        Team2  = searchQuery.Team2,
                        lscore = "https://apifootball.com/api/?action=get_events&from=2016-10-30&to=2016-11-01&league_id=62&APIkey=ac41d66e732ff9ef06a1e697e79a039bbb971bf7f093014e9b200c0003bdbd63",
                        // Rating = random.Next(1, 5),
                        // NumberOfReviews = random.Next(0, 5000),
                        // PriceStarting = random.Next(80, 450),
                        Image      = $"https://www.games4reloaded.com/wp-content/uploads/2018/07/prediction-800x445.jpg",
                        MoreImages = new List <string>()
                        {
                            "https://nesncom.files.wordpress.com/2018/07/samuel-umtiti.jpg?w=640",
                            "https://media.fox4news.com/media.fox4news.com/photo/2018/07/09/France%20vs%20Belgium_1531173430360.jpg_5771874_ver1.0_640_360.jpg",
                            "https://images.indianexpress.com/2018/07/fifa-ap-m.jpg",
                            "https://cdn.images.dailystar.co.uk/dynamic/1/photos/437000/France-vs-Belgium-World-Cup-Russia-semi-final-girls-1389437.jpg"
                        }
                    };
                    livescore.Add(match);
                }
                else
                {
                    Livescore match = new Livescore()
                    {
                        Name   = $"Match No. {i}",
                        Team1  = searchQuery.Team1,
                        Team2  = searchQuery.Team2,
                        lscore = "https://apifootball.com/api/?action=get_events&from=2016-10-30&to=2016-11-01&league_id=62&APIkey=ac41d66e732ff9ef06a1e697e79a039bbb971bf7f093014e9b200c0003bdbd63",
                        // Rating = random.Next(1, 5),
                        // NumberOfReviews = random.Next(0, 5000),
                        // PriceStarting = random.Next(80, 450),
                        Image      = $"https://www.games4reloaded.com/wp-content/uploads/2018/07/prediction-800x445.jpg",
                        MoreImages = new List <string>()
                        {
                            "https://nesncom.files.wordpress.com/2018/07/samuel-umtiti.jpg?w=640",
                            "https://media.fox4news.com/media.fox4news.com/photo/2018/07/09/France%20vs%20Belgium_1531173430360.jpg_5771874_ver1.0_640_360.jpg",
                            "https://images.indianexpress.com/2018/07/fifa-ap-m.jpg",
                            "https://cdn.images.dailystar.co.uk/dynamic/1/photos/437000/France-vs-Belgium-World-Cup-Russia-semi-final-girls-1389437.jpg"
                        }
                    };
                    livescore.Add(match);
                }
            }
            return(livescore);
        }