本文整理汇总了C#中Microsoft.WindowsAzure.Storage.Table.CloudTableClient.GetTableReference方法的典型用法代码示例。如果您正苦于以下问题:C# CloudTableClient.GetTableReference方法的具体用法?C# CloudTableClient.GetTableReference怎么用?C# CloudTableClient.GetTableReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.WindowsAzure.Storage.Table.CloudTableClient
的用法示例。
在下文中一共展示了CloudTableClient.GetTableReference方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestCacheStats
public TestCacheStats(TestResultStorage testResultStorage, CloudTableClient tableClient)
{
_testResultStorage = testResultStorage;
_unitTestCounterUtil = new CounterUtil<UnitTestCounterEntity>(tableClient.GetTableReference(AzureConstants.TableNames.CounterUnitTestQuery));
_testCacheCounterUtil = new CounterUtil<TestCacheCounterEntity>(tableClient.GetTableReference(AzureConstants.TableNames.CounterTestCache));
_testRunCounterUtil = new CounterUtil<TestRunCounterEntity>(tableClient.GetTableReference(AzureConstants.TableNames.CounterTestRun));
}
示例2: TableStorageSiteUrlRepository
public TableStorageSiteUrlRepository(IStorageQueueConfiguration configuration)
{
_storageAccount = CloudStorageAccount.Parse(configuration.GetConnectionString());
_tableClient = _storageAccount.CreateCloudTableClient();
_tableClient.GetTableReference(_tableName);
_tableClient.GetTableReference(_tableName).CreateIfNotExists();
_tableContext = _tableClient.GetTableServiceContext();
}
示例3: StorageWrapper
public StorageWrapper()
{
_storageAccount = CloudStorageAccount.Parse(
RoleEnvironment.GetConfigurationSettingValue(_connectionStringName)
);
_tableClient = _storageAccount.CreateCloudTableClient();
_tableClient.GetTableReference(_tableName);
_tableClient.GetTableReference(_tableName).CreateIfNotExists();
_tableContext = _tableClient.GetTableServiceContext();
}
示例4: TableEventStore
public TableEventStore(CloudStorageAccount cloudStorageAccount, string domainPrefix)
{
this.cloudStorageAccount = cloudStorageAccount;
this.domainPrefix = domainPrefix;
cloudTableClient = cloudStorageAccount.CreateCloudTableClient();
cloudTableClient.RetryPolicy = new ExponentialRetry(TimeSpan.FromMilliseconds(100), 20);
EventStoreTable = cloudTableClient.GetTableReference(domainPrefix + "EventStore");
EventStoreTable.CreateIfNotExists();
logTable = cloudTableClient.GetTableReference(domainPrefix + "ConsumptionLog");
logTable.CreateIfNotExists();
}
示例5: SpeakerService
public SpeakerService(string speakerId)
{
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["pocketDDDCloudStorage"].ConnectionString);
this.tableClient = storageAccount.CreateCloudTableClient();
this.userCommentsTable = tableClient.GetTableReference("Comments");
this.userSessionDataTable = tableClient.GetTableReference("UserSessionData");
var speakerLookupService = new SpeakerLookupService();
this.speakerMapping = speakerLookupService.GetSpeakerMapping(speakerId);
if (this.speakerMapping == null)
throw new ApplicationException("Invalid speakerId");
}
示例6: UserGeneratedDataService
public UserGeneratedDataService(EventsService eventsService, UserService userService, IList<DDDEventDataInfo> dddEventDataInfo)
{
this.userService = userService;
this.eventsService = eventsService;
this.dddEventDataInfo = dddEventDataInfo;
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["pocketDDDCloudStorage"].ConnectionString);
this.tableClient = storageAccount.CreateCloudTableClient();
this.userCommentsTable = tableClient.GetTableReference("Comments");
this.userSessionDataTable = tableClient.GetTableReference("UserSessionData");
this.userEventDataTable = tableClient.GetTableReference("UserEventData");
}
示例7: Configure
public void Configure()
{
// Create the table client.
_tableClient = _storageAccount.CreateCloudTableClient();
_urltable = _tableClient.GetTableReference("url");
_indextable = _tableClient.GetTableReference("index");
// Create the table if it doesn't exist
_urltable.CreateIfNotExistsAsync().Wait();
_indextable.CreateIfNotExistsAsync().Wait();
// Create index if it doesn't exist
createIndexIfNotExist().Wait();
}
示例8: CleanupTable
private void CleanupTable(string tableName)
{
var account = CloudStorageAccount.DevelopmentStorageAccount;
var cloudTableClient = new CloudTableClient(account.TableEndpoint, account.Credentials);
var table = cloudTableClient.GetTableReference(tableName);
table.DeleteIfExists();
}
示例9: TProduct
public TProduct(string affiliate, string code, int qty, bool force_lookup = false)
{
ProductCode = code;
Qty = qty;
cloud = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("AbundaStorage"));
client = cloud.CreateCloudTableClient();
products = client.GetTableReference("Products");
products.CreateIfNotExists();
using (var context = new DataBaseDataContext())
{
var aff = (from ev in context.Affiliates
where ev.code == affiliate
select ev).FirstOrDefault();
merchantID = aff.MerchantID;
marketplaceID = aff.MarketPlaceID;
secretKey = aff.SecretKey;
accessKey = aff.AccessKey;
}
var amzResults = PerformAmazonLookup();
}
示例10: StorageTableAccessor
public StorageTableAccessor(CloudStorageAccount storageAccount)
{
CloudTableClient tableClient = new CloudTableClient(storageAccount.TableStorageUri, storageAccount.Credentials);
this.table = tableClient.GetTableReference(messageTableName);
this.table.CreateIfNotExists();
ReadFirstEntry();
}
示例11: TableHelper
public TableHelper(CloudTableClient client)
{
urlTable = client.GetTableReference("urltable");
dataTable = client.GetTableReference("datatable");
errorTable = client.GetTableReference("errortable");
urlTable.CreateIfNotExists();
dataTable.CreateIfNotExists();
errorTable.CreateIfNotExists();
lastTenErrors = new Queue<string>();
lastTenUrls = new Queue<string>();
crawledSize = int.Parse(get(dataTable, "data", "count", "0"));
queueSize = int.Parse(get(dataTable, "data", "queuesize", "0"));
errorSize = int.Parse(get(dataTable, "data", "errorsize", "0"));
}
示例12: NDIAzureTableController
static NDIAzureTableController()
{
_storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
_tableClient = _storageAccount.CreateCloudTableClient();
_table = _tableClient.GetTableReference("ndiparams");
_retrieveOperation = TableOperation.Retrieve("VidParams", "LastVideo");
}
示例13: SensorAccess
public SensorAccess()
{
credentials = new StorageCredentials(_accountName, _key);
storageAccount = new CloudStorageAccount(credentials, true);
tableClient = storageAccount.CreateCloudTableClient();
table = tableClient.GetTableReference("AccelerometerTable");
}
示例14: CreateCustomerMetadata
static void CreateCustomerMetadata(CloudTableClient tableClient)
{
Console.WriteLine("Creating customers metadata...");
CloudTable customersMetadataTable = tableClient.GetTableReference("customersmetadata");
customersMetadataTable.CreateIfNotExists();
var msftAddress1 = new DictionaryTableEntity();
msftAddress1.PartitionKey = "MSFT";
msftAddress1.RowKey = "ADDRESS-" + Guid.NewGuid().ToString("N").ToUpper();
msftAddress1.Add("city", "Seattle");
msftAddress1.Add("street", "111 South Jackson");
var msftWebsite1 = new DictionaryTableEntity();
msftWebsite1.PartitionKey = "MSFT";
msftWebsite1.RowKey = "WEBSITE-" + Guid.NewGuid().ToString("N").ToUpper();
msftWebsite1.Add("url", "http://www.microsoft.com");
var msftWebsite2 = new DictionaryTableEntity();
msftWebsite2.PartitionKey = "MSFT";
msftWebsite2.RowKey = "WEBSITE-" + Guid.NewGuid().ToString("N").ToUpper();
msftWebsite2.Add("url", "http://www.windowsazure.com");
var batch = new TableBatchOperation();
batch.Add(TableOperation.Insert(msftAddress1));
batch.Add(TableOperation.Insert(msftWebsite1));
batch.Add(TableOperation.Insert(msftWebsite2));
customersMetadataTable.ExecuteBatch(batch);
Console.WriteLine("Done. Press ENTER to read the customer metadata.");
Console.ReadLine();
}
示例15: HomeController
public HomeController()
{
storageAccount = CloudStorageAccount.Parse(
ConfigurationManager.AppSettings["StorageConnectionString"]);
tableClient = storageAccount.CreateCloudTableClient();
table = tableClient.GetTableReference("fouramigos");
table.CreateIfNotExists();
blobClient = storageAccount.CreateCloudBlobClient();
container = blobClient.GetContainerReference("fouramigos");
container.CreateIfNotExists();
BlobContainerPermissions permissions = container.GetPermissions();
permissions.PublicAccess = BlobContainerPublicAccessType.Container;
container.SetPermissions(permissions);
//lägga till nya
//var tablemodels = new TableModel("Brutus", "Uggla") { Location = "T4", Description="Uggla i träd", Type="Foto" };
//var tablemodels1 = new TableModel("brutus", "Örn") { Location = "T4", Description="Örn som flyger", Type = "Foto" };
//var opreation = TableOperation.Insert(tablemodels);
//var operation2 = TableOperation.Insert(tablemodels1);
//table.Execute(opreation);
//table.Execute(operation2);
}