Пример #1
0
        /// <summary>
        /// Method deserialize JSON's from website.
        /// </summary>
        /// <returns>Return CinemaLocation type</returns>
        public CinemaLocation GetJson()
        {
            HttpClient client = new HttpClient();
            var        json   = client.GetStringAsync(@"https://multikino.pl/data/locations/").Result;
            var        result = CinemaLocation.FromJson(json);

            return(result);
        }
Пример #2
0
        /// <summary>
        /// Method deserialize JSON's from file.
        /// </summary>
        /// <returns>Return CinemaLocation type</returns>
        public CinemaLocation GetJson()
        {
            string path2 = new DirectoryInfo(Environment.CurrentDirectory).Parent.Parent.Parent.FullName; // Path to Project Directory
            string path  = Path.Combine(path2, @"Kinoman.Tests\TestFiles\CinemaIDJson.json");             //Path to file directory in project directory
            var    json  = File.ReadAllText(path, Encoding.Default).ToString();
            //Console.WriteLine(json);
            var data = CinemaLocation.FromJson(json);

            return(data);
        }
Пример #3
0
 /// <summary>
 /// Constructior take as parameter CinemaLocation type which store deserialized JSON with cinemas locations
 /// </summary>
 public CinemaIdDownloader(CinemaLocation venueParsedJson)
 {
     Venue = venueParsedJson;
 }
Пример #4
0
 public static string ToJson(this CinemaLocation self) => JsonConvert.SerializeObject(self, ConverterCinemaVenue.Settings);