public void TestConnectToAzure() { // retrieve the connection string NameValueCollection appsettings = ConfigurationManager.AppSettings; string storageConnectionString = appsettings["StorageConnectionString"]; WindowsAzureTableStorageService dao = new WindowsAzureTableStorageService(storageConnectionString); dao.createCloudTableClient(); }
public void TestCreateEntity() { // retrieve the connection string NameValueCollection appsettings = ConfigurationManager.AppSettings; string storageConnectionString = appsettings["StorageConnectionString"]; WindowsAzureTableStorageService dao = new WindowsAzureTableStorageService(storageConnectionString); dao.createCloudTableClient(); dao.CreateTable("test"); DictionaryTableEntity entity = new DictionaryTableEntity(); entity.PartitionKey = "Test"; entity.RowKey = Guid.NewGuid().ToString(); entity.Add("city", "seattle"); entity.Add("street", "111 South Jackson"); dao.AddEntity("test", entity); }
public void TestCreateBatchesLessThan100Records() { // retrieve the connection string NameValueCollection appsettings = ConfigurationManager.AppSettings; string storageConnectionString = appsettings["StorageConnectionString"]; WindowsAzureTableStorageService dao = new WindowsAzureTableStorageService(storageConnectionString); dao.createCloudTableClient(); dao.CreateTable("test"); List <ITableEntity> entities = new List <ITableEntity>(); for (int i = 0; i < 50; i++) { DictionaryTableEntity entity = new DictionaryTableEntity(); entity.PartitionKey = "Test"; entity.RowKey = Guid.NewGuid().ToString(); entity.Add("city", "seattle"); entity.Add("street", "111 South Jackson"); entities.Add(entity); } dao.AddBatch("test", entities); }