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


C# CloudTableClient.GetDataServiceContext方法代码示例

本文整理汇总了C#中Microsoft.WindowsAzure.StorageClient.CloudTableClient.GetDataServiceContext方法的典型用法代码示例。如果您正苦于以下问题:C# CloudTableClient.GetDataServiceContext方法的具体用法?C# CloudTableClient.GetDataServiceContext怎么用?C# CloudTableClient.GetDataServiceContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.WindowsAzure.StorageClient.CloudTableClient的用法示例。


在下文中一共展示了CloudTableClient.GetDataServiceContext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: PersistPrimeSum

 public PersistPrimeSum()
 {
     tableClient = storageAccount.CreateCloudTableClient();
     tableClient.CreateTableIfNotExist(TheTableName);
     tableServiceContext = tableClient.GetDataServiceContext();
     tableServiceContext.IgnoreResourceNotFoundException = true;
 }
开发者ID:sseyalioglu,项目名称:AzureWebAndWorker_For_PrimeSumFinder_withScale,代码行数:7,代码来源:PersistPrimeSum.cs

示例3: PushServiceTokenRepository

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

示例4: AzureStorageClient

 public AzureStorageClient()
 {
     CloudStorageAccount account = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
     mTableClient = account.CreateCloudTableClient();
     mTableClient.CreateTableIfNotExist(TranslationTable);
     mContext = mTableClient.GetDataServiceContext();
     mContext.IgnoreResourceNotFoundException = true;
 }
开发者ID:cchitsiang,项目名称:Multi-Lingual-Chat,代码行数:8,代码来源:AzureStorageClient.cs

示例5: TableStorageSiteUrlRepository

        public TableStorageSiteUrlRepository()
        {
            _storageAccount = CloudStorageAccount.Parse(
                CloudConfigurationManager.GetSetting(_connectionStringName)
                );

            _tableClient = new CloudTableClient(_storageAccount.TableEndpoint.AbsoluteUri, _storageAccount.Credentials);
            _tableClient.RetryPolicy = RetryPolicies.Retry(3, TimeSpan.FromSeconds(1));
            _tableClient.CreateTableIfNotExist(_tableName);
            _tableContext = _tableClient.GetDataServiceContext();
        }
开发者ID:woloski,项目名称:SiteMonitR,代码行数:11,代码来源:TableStorageSiteUrlRepository.cs

示例6: StorageWrapper

 public StorageWrapper()
 {
     _storageAccount = CloudStorageAccount.Parse(
         RoleEnvironment.GetConfigurationSettingValue(_connectionStringName)
         );
     _tableClient = new CloudTableClient(_storageAccount.TableEndpoint.AbsoluteUri,
         _storageAccount.Credentials);
     _tableClient.RetryPolicy = RetryPolicies.Retry(3, TimeSpan.FromSeconds(1));
     _tableClient.CreateTableIfNotExist(_tableName);
     _tableContext = _tableClient.GetDataServiceContext();
 }
开发者ID:AndyCross,项目名称:CloudMonitR,代码行数:11,代码来源:StorageWrapper.cs

示例7: NotificationRepository

        public NotificationRepository()
        {
            // Retrieve storage account from connection-string
            storageAccount = CloudStorageAccount.Parse(Properties.Settings.Default.DataStorageConnectionString);

            // Create the table client
            tableClient = storageAccount.CreateCloudTableClient();
            tableClient.CreateTableIfNotExist(tableName);

            // Get the data service context
            context = tableClient.GetDataServiceContext();
        }
开发者ID:AppliedIS,项目名称:AzureTicker,代码行数:12,代码来源:NotificationRepository.cs

示例8: NotificationRepository

        public NotificationRepository()
        {
            // Retrieve storage account from connection-string
            storageAccount = CloudStorageAccount.Parse(
                CloudConfigurationManager.GetSetting(Constants.DataStorageConnectionStringKey));

            // Create the table client
            tableClient = storageAccount.CreateCloudTableClient();
            tableClient.CreateTableIfNotExist(tableName);

            // Get the data service context
            context = tableClient.GetDataServiceContext();
        }
开发者ID:AppliedIS,项目名称:AzureTicker,代码行数:13,代码来源:NotificationRepository.cs

示例9: AzureStorageOld

        public AzureStorageOld(string account, string key, string table, bool nagling = true)
        {
            this._account = this.GetStorageAccount(account, key);

            EnableNagling(nagling);
            this._client = _account.CreateCloudTableClient();

            this._table = table;

            this.CreateTable(table);

            this._context = _client.GetDataServiceContext();
        }
开发者ID:WorldWayno,项目名称:AzureStorageTests,代码行数:13,代码来源:AzureStorageOld.cs

示例10: DatabaseManager

        private DatabaseManager()
        {
            // Retrieve the storage account from the connection string
            storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));

            // Create the table client
            tableClient = storageAccount.CreateCloudTableClient();

            // Create the table if it doesn't exist
            tableClient.CreateTableIfNotExist(tableName);

            // Get the data service context
            serviceContext = tableClient.GetDataServiceContext();
        }
开发者ID:Japskua,项目名称:QRAdventures,代码行数:14,代码来源:DatabaseManager.cs

示例11: QueryLogTable

        private static void QueryLogTable(CloudTableClient tableStorage)
        {
            TableServiceContext context = tableStorage.GetDataServiceContext();
            DataServiceQuery query = context.CreateQuery<LogEntry>(TableStorageTraceListener.DIAGNOSTICS_TABLE)
                                            .Where(entry => entry.PartitionKey.CompareTo(lastPartitionKey) > 0 
                                               || (entry.PartitionKey == lastPartitionKey && entry.RowKey.CompareTo(lastRowKey) > 0)) 
                                                as DataServiceQuery;

            foreach (AzureDiagnostics.LogEntry entry in query.Execute())
            {
                Console.WriteLine("{0} - {1}", entry.Timestamp, entry.Message);
                lastPartitionKey = entry.PartitionKey;
                lastRowKey = entry.RowKey;
            }
        }
开发者ID:Helen1987,项目名称:edu,代码行数:15,代码来源:Program.cs

示例12: CreatePushNotificationTable

        private static void CreatePushNotificationTable(CloudTableClient cloudTableClient)
        {
            cloudTableClient.CreateTableIfNotExist(UserTablesServiceContext.PushUserTableName);

            // Execute conditionally for development storage only.
            if (cloudTableClient.BaseUri.IsLoopback)
            {
                var context = cloudTableClient.GetDataServiceContext();
                var entity = new PushUserEndpoint { UserId = "UserName", ChannelUri = "http://tempuri", TileCount = 0 };

                context.AddObject(UserTablesServiceContext.PushUserTableName, entity);
                context.SaveChangesWithRetries();
                context.DeleteObject(entity);
                context.SaveChangesWithRetries();
            }
        }
开发者ID:Setuber,项目名称:Ringify,代码行数:16,代码来源:WebRole.cs

示例13: CreateUserPrivilegeTable

        private static void CreateUserPrivilegeTable(CloudTableClient cloudTableClient)
        {
            cloudTableClient.CreateTableIfNotExist(PrivilegesTableServiceContext.UserPrivilegeTableName);

            // Execute conditionally for development storage only.
            if (cloudTableClient.BaseUri.IsLoopback)
            {
                TableServiceContext context = cloudTableClient.GetDataServiceContext();
                var entity = new UserPrivilege { UserId = "UserId", Privilege = "Privilege" };

                context.AddObject(PrivilegesTableServiceContext.UserPrivilegeTableName, entity);
                context.SaveChangesWithRetries();
                context.DeleteObject(entity);
                context.SaveChangesWithRetries();
            }
        }
开发者ID:kirpasingh,项目名称:MicrosoftAzureTrainingKit,代码行数:16,代码来源:CloudStorageInitializer.cs

示例14: GetRdfMetadataColumnNamespace

        public static List<TableColumnsMetadataEntity> GetRdfMetadataColumnNamespace(string entitySet)
        {
            CloudTableClient tableClient = new CloudTableClient(s_account.TableEndpoint.ToString(), s_account.Credentials);

            TableServiceContext tableServiceContext = tableClient.GetDataServiceContext();

            string queryTemplate = "{0}?$filter=entityset eq '{1}'";

            string query = string.Format(queryTemplate, DataLoaderConstants.TableColumnsMetadataTableName, entitySet);
            List<TableColumnsMetadataEntity> resultsQuery = tableServiceContext.Execute<TableColumnsMetadataEntity>(new Uri(query, UriKind.Relative)).ToList();
            if (resultsQuery.Count > 0)
            {
                return resultsQuery;
            }
            else
            {
                return null;
            }
        }
开发者ID:aytacozkan,项目名称:OGDI-DataLab,代码行数:19,代码来源:TableDataLoader.cs

示例15: GeneratePastEventLogMessagesForConferenceManagement

        public void GeneratePastEventLogMessagesForConferenceManagement(
            CloudTableClient messageLogClient, string messageLogName,
            string conferenceManagementConnectionString,
            IMetadataProvider metadataProvider, ITextSerializer serializer)
        {
            retryPolicy.ExecuteAction(() => messageLogClient.CreateTableIfNotExist(messageLogName));

            // set the creation date to just before releasing V1 (previous month).
            var eventCreationDate = new DateTime(2012, 04, 01, 0, 0, 0, DateTimeKind.Utc);

            var generatedEvents = this.GenerateMissedConferenceManagementIntegrationEvents(conferenceManagementConnectionString);
            foreach (var evt in generatedEvents)
            {
                // generate events in ascending order. If there is a conflict when saving (currently silently swallowed by AzureEventLogWriter), 
                // then the migration process is being run for the second time, which is wrong.
                // TODO: what happens if the process crashes middleway.
                eventCreationDate = eventCreationDate.AddSeconds(1);
                var metadata = metadataProvider.GetMetadata(evt);
                var entry = new MessageLogEntity
                {
                    PartitionKey = eventCreationDate.ToString("yyyMM"),
                    // could have a prefix instead of suffix to be able to search
                    RowKey = eventCreationDate.Ticks.ToString("D20") + "_Generated",
                    CreationDate = eventCreationDate.ToString("o"),
                    MessageId = null,
                    CorrelationId = null,
                    SourceType = null,
                    SourceId = evt.SourceId.ToString(),
                    AssemblyName = metadata[StandardMetadata.AssemblyName],
                    FullName = metadata[StandardMetadata.FullName],
                    Namespace = metadata[StandardMetadata.Namespace],
                    TypeName = metadata[StandardMetadata.TypeName],
                    Kind = StandardMetadata.EventKind,
                    Payload = serializer.Serialize(evt),
                };

                var context = messageLogClient.GetDataServiceContext();
                context.AddObject(messageLogName, entry);
                retryPolicy.ExecuteAction(() => context.SaveChanges());
            }
        }
开发者ID:AlexShkorParalect,项目名称:cqrs-journey-code,代码行数:41,代码来源:Migrator.cs


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