Inheritance: TableStorageProvider
Beispiel #1
0
      public void TestInitialize()
      {
         ICloudStorageAccount storageAccount = Configuration.GetTestStorageAccount();

         _tableStorageProvider = new AzureTableStorageProvider( storageAccount );

         _client = new CloudTableClient( new Uri( storageAccount.TableEndpoint ), storageAccount.Credentials );

         _tableName = _baseTableName + Guid.NewGuid().ToString().Replace( "-", string.Empty );

         var table = _client.GetTableReference( _tableName );
         table.CreateAsync().Wait();
      }
Beispiel #2
0
        public ActionResult Index( SubmitEmail model )
        {
            if ( ModelState.IsValid )
             {
            var connectionString = GlobalConfig.GetString( "BylditStorageAccountConnectionString" );
            var storageAccount = CloudStorageAccount.Parse( connectionString );
            var tableStorageProvider = new AzureTableStorageProvider( new CloudStorageAccountAdapter( storageAccount ) );
            var emailTableName = GlobalConfig.GetString( "SubmitEmailTableName" );

            storageAccount.CreateCloudTableClient().GetTableReference( emailTableName ).CreateIfNotExists();

            tableStorageProvider.Upsert( emailTableName, model );
            tableStorageProvider.Save();

            model.Submitted = true;
             }

             return View( model );
        }
Beispiel #3
0
        public void TestInitialize()
        {
            ICloudStorageAccount storageAccount = new ConnectionStringCloudStorageAccount( ConfigurationManager.AppSettings["storageConnectionString"] );

             _tableStorageProvider = new AzureTableStorageProvider( storageAccount );

             _client = new CloudTableClient( new Uri( storageAccount.TableEndpoint ), storageAccount.Credentials );

             _tableName = _baseTableName + Guid.NewGuid().ToString().Replace( "-", string.Empty );

             var table = _client.GetTableReference( _tableName );
             table.Create();
        }