当前位置: 首页>>代码示例>>C#>>正文


C# CloudStorageAccount.CreateCloudTableClient方法代码示例

本文整理汇总了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);
        }
开发者ID:crafters,项目名称:msdn-azure,代码行数:26,代码来源:MsdnDataSource.cs

示例2: PushServiceTokenRepository

 public PushServiceTokenRepository()
 {
     storage = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("StorageConnectionString"));
     client = storage.CreateCloudTableClient();
     client.CreateTableIfNotExist(TableName);
     context = client.GetDataServiceContext();
 }
开发者ID:mchambers,项目名称:Daremeto,代码行数:7,代码来源:PushServiceTokenRepository.cs

示例3: AzureCommandLogReader

 public AzureCommandLogReader(CloudStorageAccount account, string tableName, ITextSerializer serializer) : 
     base(account, tableName, serializer)
 {
     this.tableName = tableName;
     this.serializer = serializer;
     this.tableClient = account.CreateCloudTableClient();
 }
开发者ID:wayne-o,项目名称:delete-me,代码行数:7,代码来源:AzureCommandLogReader.cs

示例4: UserDataSource

        public UserDataSource(CloudStorageAccount storageAccount)
        {
            _storageAccount = storageAccount;
            _cloudTableClient = storageAccount.CreateCloudTableClient();

            _cloudTableClient.CreateTableIfNotExist("Users");
        }
开发者ID:luiseduardohdbackup,项目名称:dotnet-1,代码行数:7,代码来源:UserDataSource.cs

示例5: FriendshipRepository

 public FriendshipRepository()
 {
     storage = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"]);
     client = storage.CreateCloudTableClient();
     client.CreateTableIfNotExist(TableName);
     context = client.GetDataServiceContext();
 }
开发者ID:mchambers,项目名称:howmuchto-service,代码行数:7,代码来源:FriendshipRepository.cs

示例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));
        }
开发者ID:TiagoTerra,项目名称:cqrs-journey,代码行数:33,代码来源:EventStore.cs

示例7: AzureEventStore

        public AzureEventStore(CloudStorageAccount storageAccount)
        {
            _account = storageAccount;
            _tableClient = _account.CreateCloudTableClient();

            InitializeStorage();
        }
开发者ID:SzymonPobiega,项目名称:ncqrs,代码行数:7,代码来源:AzureEventStore.cs

示例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();
        }
开发者ID:cloudscrubs,项目名称:azureprototype,代码行数:33,代码来源:Service1.svc.cs

示例9: ErrorMapContext

 public ErrorMapContext()
 {
     StorageAccount = CloudStorageAccount.FromConfigurationSetting(ConfigurationName);
     CloudTableClient TableClient = StorageAccount.CreateCloudTableClient();
     TableClient.CreateTableIfNotExist(TableName);
     servCtx = TableClient.GetDataServiceContext();
 }
开发者ID:hooookmeup,项目名称:hookmeup,代码行数:7,代码来源:ErrorMapping.cs

示例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();
        }
开发者ID:cloudscrubs,项目名称:azureprototype,代码行数:28,代码来源:WorkerRole.cs

示例11: InitializeCloudStorage

        public static void InitializeCloudStorage(CloudStorageAccount account)
        {
            CloudTableClient cloudTableClient = account.CreateCloudTableClient();
            CloudQueueClient cloudQueueClient = account.CreateCloudQueueClient();

            CreateUserPrivilegeTable(cloudTableClient);
        }
开发者ID:kirpasingh,项目名称:MicrosoftAzureTrainingKit,代码行数:7,代码来源:CloudStorageInitializer.cs

示例12: PushServiceTokenRepository

 public PushServiceTokenRepository()
 {
     storage = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"]);
     client = storage.CreateCloudTableClient();
     client.CreateTableIfNotExist(TableName);
     context = new TableServiceContextV2(client.BaseUri.ToString(), client.Credentials);
 }
开发者ID:mchambers,项目名称:howmuchto-service,代码行数:7,代码来源:PushServiceTokenRepository.cs

示例13: PushServiceTokenRepository

 public PushServiceTokenRepository()
 {
     storage = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("StorageConnectionString"));
     client = storage.CreateCloudTableClient();
     client.CreateTableIfNotExist(TableName);
     context = new TableServiceContextV2(client.BaseUri.ToString(), client.Credentials);
 }
开发者ID:mchambers,项目名称:Daremeto,代码行数:7,代码来源:PushServiceTokenRepository.cs

示例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" });
 }
开发者ID:richorama,项目名称:AzureSugar,代码行数:8,代码来源:DynamicTableTest.cs

示例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;
        }
开发者ID:dfberry,项目名称:AzureWorkerRole,代码行数:14,代码来源:WebRoleMgr.cs


注:本文中的Microsoft.WindowsAzure.CloudStorageAccount.CreateCloudTableClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。