Пример #1
0
        static async Task <Uri> CreateRecords(Timeseriesclass tsc)
        {
            HttpResponseMessage response = await client.PostAsJsonAsync("api/put", tsc);

            response.EnsureSuccessStatusCode();
            return(response.Headers.Location);
        }
Пример #2
0
        public static void LoadJson()
        {
            Timeseriesclass tsc           = new Timeseriesclass();
            string          sFullFilePath = @"C:\TS\file3.json";

            using (StreamReader r = new StreamReader(sFullFilePath))
            {
                string jsonfile = r.ReadToEnd();
                List <Timeseriesclass> series = JsonConvert.DeserializeObject <List <Timeseriesclass> >(jsonfile);
                RunAsync(series).GetAwaiter().GetResult();
                //foreach(var item in items)
                //{
                //    Console.WriteLine("{0} - {1} - {2}", item.,;
                //}
            }
        }