本文整理汇总了C#中Microsoft.WindowsAzure.CloudStorageAccount.CreateCloudTableClient方法的典型用法代码示例。如果您正苦于以下问题:C# CloudStorageAccount.CreateCloudTableClient方法的具体用法?C# CloudStorageAccount.CreateCloudTableClient怎么用?C# CloudStorageAccount.CreateCloudTableClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.WindowsAzure.CloudStorageAccount
的用法示例。
在下文中一共展示了CloudStorageAccount.CreateCloudTableClient方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MsdnDataSource
static MsdnDataSource()
{
CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetter) => {
string connectionString = string.Empty;
if (RoleEnvironment.IsAvailable) {
connectionString = RoleEnvironment.GetConfigurationSettingValue(configName);
}
//else {
// connectionString = ConfigurationManager.AppSettings[configName];
//}
configSetter(connectionString);
});
storageAccount = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");
storageAccount.CreateCloudTableClient().CreateTableIfNotExist("Namespaces");
storageAccount.CreateCloudTableClient().CreateTableIfNotExist("Types");
storageAccount.CreateCloudTableClient().CreateTableIfNotExist("Members");
//CloudTableClient.CreateTablesFromModel(
// typeof(NamespaceMetaInfo),
// storageAccount.TableEndpoint.AbsoluteUri,
// storageAccount.Credentials);
}
示例2: PushServiceTokenRepository
public PushServiceTokenRepository()
{
storage = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("StorageConnectionString"));
client = storage.CreateCloudTableClient();
client.CreateTableIfNotExist(TableName);
context = client.GetDataServiceContext();
}
示例3: AzureCommandLogReader
public AzureCommandLogReader(CloudStorageAccount account, string tableName, ITextSerializer serializer) :
base(account, tableName, serializer)
{
this.tableName = tableName;
this.serializer = serializer;
this.tableClient = account.CreateCloudTableClient();
}
示例4: UserDataSource
public UserDataSource(CloudStorageAccount storageAccount)
{
_storageAccount = storageAccount;
_cloudTableClient = storageAccount.CreateCloudTableClient();
_cloudTableClient.CreateTableIfNotExist("Users");
}
示例5: FriendshipRepository
public FriendshipRepository()
{
storage = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"]);
client = storage.CreateCloudTableClient();
client.CreateTableIfNotExist(TableName);
context = client.GetDataServiceContext();
}
示例6: EventStore
public EventStore(CloudStorageAccount account, string tableName)
{
if (account == null) throw new ArgumentNullException("account");
if (tableName == null) throw new ArgumentNullException("tableName");
if (string.IsNullOrWhiteSpace(tableName)) throw new ArgumentException("tableName");
this.account = account;
this.tableName = tableName;
this.tableClient = account.CreateCloudTableClient();
this.tableClient.RetryPolicy = RetryPolicies.NoRetry();
// TODO: This could be injected.
var backgroundRetryStrategy = new ExponentialBackoff(10, TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(1));
var blockingRetryStrategy = new Incremental(3, TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(1));
this.pendingEventsQueueRetryPolicy = new RetryPolicy<StorageTransientErrorDetectionStrategy>(backgroundRetryStrategy);
this.pendingEventsQueueRetryPolicy.Retrying += (s, e) =>
{
var handler = this.Retrying;
if (handler != null)
{
handler(this, EventArgs.Empty);
}
Trace.TraceWarning("An error occurred in attempt number {1} to access table storage (PendingEventsQueue): {0}", e.LastException.Message, e.CurrentRetryCount);
};
this.eventStoreRetryPolicy = new RetryPolicy<StorageTransientErrorDetectionStrategy>(blockingRetryStrategy);
this.eventStoreRetryPolicy.Retrying += (s, e) => Trace.TraceWarning(
"An error occurred in attempt number {1} to access table storage (EventStore): {0}",
e.LastException.Message,
e.CurrentRetryCount);
this.eventStoreRetryPolicy.ExecuteAction(() => tableClient.CreateTableIfNotExist(tableName));
}
示例7: AzureEventStore
public AzureEventStore(CloudStorageAccount storageAccount)
{
_account = storageAccount;
_tableClient = _account.CreateCloudTableClient();
InitializeStorage();
}
示例8: AddAilmentDetails
//ADD AILMENT DETAILS
public void AddAilmentDetails(AilmentDetails AilData)
{
#if DEBUG
account = CloudStorageAccount.DevelopmentStorageAccount;
#else
account = new CloudStorageAccount(accountAndKey, true);
#endif
client = account.CreateCloudTableClient();
client.CreateTableIfNotExist("PatientDetails");
tableContext = new TableServiceContext(account.TableEndpoint.ToString(), account.Credentials);
AilmentDetails x = new AilmentDetails();
x.AttendingPhysician = AilData.AttendingPhysician;
x.Diagnosis = AilData.Diagnosis;
x.DiagnosisID = AilData.DiagnosisID;
x.GeneralPhysician = AilData.GeneralPhysician;
x.Hospital = AilData.Hospital;
x.Lab_Pathology = AilData.Lab_Pathology;
x.Lab_Physical = AilData.Lab_Physical;
x.Lab_Radiology = AilData.Lab_Physical;
x.Medication = AilData.Medication;
x.PatientIDLinkRowKey = AilData.PatientIDLinkRowKey;
x.ProgressNotes = AilData.ProgressNotes;
x.Symptoms = AilData.Symptoms;
x.TimeIn = AilData.TimeIn;
x.TimeOut = AilData.TimeOut;
x.Treatment = AilData.Treatment;
x.AilmentDetailRowKey = AilData.AilmentDetailRowKey;
tableContext.AddObject("PatientDetails", x);
tableContext.SaveChanges();
}
示例9: ErrorMapContext
public ErrorMapContext()
{
StorageAccount = CloudStorageAccount.FromConfigurationSetting(ConfigurationName);
CloudTableClient TableClient = StorageAccount.CreateCloudTableClient();
TableClient.CreateTableIfNotExist(TableName);
servCtx = TableClient.GetDataServiceContext();
}
示例10: OnStart
public override bool OnStart()
{
// Set the maximum number of concurrent connections
ServicePointManager.DefaultConnectionLimit = 12;
#if DEBUG
account = CloudStorageAccount.DevelopmentStorageAccount;
#else
account = new CloudStorageAccount(accountAndKey, true);
#endif
tableContext = new TableServiceContext(account.TableEndpoint.ToString(), account.Credentials);
//client = new CloudQueueClient(account.BlobEndpoint.ToString(), account.Credentials);
qclient = account.CreateCloudQueueClient();
q = qclient.GetQueueReference("icd9mapplotrequests");
rows = new List<ICD9MapPlotResultEntry>();
bclient = account.CreateCloudBlobClient();
container = bclient.GetContainerReference("results");
container.CreateIfNotExist();
client = account.CreateCloudTableClient();
client.CreateTableIfNotExist("ICD9MapPlotResult");
client.CreateTableIfNotExist("DoctorDetails");
client.CreateTableIfNotExist("PatientDetails");
// For information on handling configuration changes
// see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
return base.OnStart();
}
示例11: InitializeCloudStorage
public static void InitializeCloudStorage(CloudStorageAccount account)
{
CloudTableClient cloudTableClient = account.CreateCloudTableClient();
CloudQueueClient cloudQueueClient = account.CreateCloudQueueClient();
CreateUserPrivilegeTable(cloudTableClient);
}
示例12: PushServiceTokenRepository
public PushServiceTokenRepository()
{
storage = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"]);
client = storage.CreateCloudTableClient();
client.CreateTableIfNotExist(TableName);
context = new TableServiceContextV2(client.BaseUri.ToString(), client.Credentials);
}
示例13: PushServiceTokenRepository
public PushServiceTokenRepository()
{
storage = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("StorageConnectionString"));
client = storage.CreateCloudTableClient();
client.CreateTableIfNotExist(TableName);
context = new TableServiceContextV2(client.BaseUri.ToString(), client.Credentials);
}
示例14: Setup
public void Setup()
{
var account = new CloudStorageAccount(new StorageCredentialsAccountAndKey(ACCOUNT_NAME, KEY), false);
var tableClient = account.CreateCloudTableClient();
tableClient.CreateTableIfNotExist(TABLE_NAME);
var context = new DynamicTableContext(TABLE_NAME, new Credentials(ACCOUNT_NAME, KEY));
context.InsertOrReplace(new { PartitionKey = "1", RowKey = "1", Value1 = "TEST" });
}
示例15: WebRoleMgr
/// <summary>
/// Constructor
/// </summary>
/// <param name="cloudStorageAccount">connection to table</param>
/// <param name="processName"></param>
/// <param name="dateEntered"></param>
public WebRoleMgr(CloudStorageAccount cloudStorageAccount, String processName, DateTime dateEntered)
{
this.cloudTableClient = cloudStorageAccount.CreateCloudTableClient();
modelFactory = new AzureDataModelFactory(this.cloudTableClient);
ProcessName = processName;
DateEntered = dateEntered;
}