Example #1
0
        /// <summary>
        /// Initializes a new instance of the SubscriptionInfoDataSource class.
        /// </summary>
        public SubscriptionInfoDataSource()
        {
            // Get the settings from the Service Configuration file
            var account = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("DataConnectionString"));

            // Create data table from MessageServiceContext
            // It is recommended the data tables should be only created once. It is typically done as a
            // provisioning step and rarely in application code.
            this.serviceContext = new MessageServiceContext(account.TableEndpoint.ToString(), account.Credentials);
            account.CreateCloudTableClient().CreateTableIfNotExist(MessageServiceContext.SubscriptionsInfoTableName);
        }
        /// <summary>
        /// Initializes a new instance of the SubscriptionDataSource class.
        /// </summary>
        public SubscriptionDataSource()
        {
            // Get the settings from the Service Configuration file
            var account = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("DataConnectionString"));

            // Create data table from MessageServiceContext 
            // It is recommended the data tables should be only created once. It is typically done as a  
            // provisioning step and rarely in application code. 
            this.serviceContext = new MessageServiceContext(account.TableEndpoint.ToString(), account.Credentials);
            account.CreateCloudTableClient().CreateTableIfNotExist(MessageServiceContext.SubscriptionsTableName);
        }