Beispiel #1
0
        private void SaveProduct(Product product)
        {
            AzureJsonDataService azuerAzureJsonDataService = new AzureJsonDataService();
            string jsonContent = azuerAzureJsonDataService.GetFileContent(@"products.json");

            List <Product> productList = JsonConvert.DeserializeObject <List <Product> >(jsonContent) ?? new List <Product>();

            productList.Add(product);
            var ser = JsonConvert.SerializeObject(productList);

            azuerAzureJsonDataService.UpdateFileContent(ser, @"products.json");
        }
Beispiel #2
0
 public PollutionScoreService()
 {
     _azuerAzureJsonDataService = new AzureJsonDataService();
 }