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"); }
public PollutionScoreService() { _azuerAzureJsonDataService = new AzureJsonDataService(); }