public void UpdateHistoryInfoToTable(WeatherInfoEntity model) { CreateBlobTableAndUploadWeatherHistoryInfo(storageAccount, model); }
private void CreateBlobTableAndUploadWeatherHistoryInfo(CloudStorageAccount storageAccount, WeatherInfoEntity weatherInfo) { //Create the table client CloudTableClient tableClient = storageAccount.CreateCloudTableClient(); //Retrieve a reference to the table CloudTable table = tableClient.GetTableReference(WeatherHistoryTable); //create the table if it doesn't exist. table.CreateIfNotExists(); //Create the tableOperation object that inserts the customer entity. //If the entry does exist, replace it TableOperation insertOrReplaceOperation = TableOperation.InsertOrReplace(weatherInfo); table.Execute(insertOrReplaceOperation); }