Example #1
0
        /// <summary>
        /// To the connection string.
        /// </summary>
        /// <param name="endpoint">The endpoint.</param>
        /// <returns>System.String.</returns>
        public static string ToConnectionString(this AzureBlobEndpoint endpoint)
        {
            if (endpoint != null)
            {
                var values = new Dictionary <string, string>
                {
                    { "Region", endpoint.Region.ToString() },
                    { "DefaultEndpointsProtocol", endpoint.Protocol.SafeToString(HttpConstants.HttpProtocols.Https) }
                };
                values.AddIfBothNotNullOrEmpty("AccountKey", endpoint.Token);
                values.AddIfBothNotNullOrEmpty("AccountName", endpoint.Account);
                values.AddIfBothNotNullOrEmpty("CustomBlobDomain", endpoint.Host);

                return(values.ToKeyValuePairString(';'));
            }

            return(string.Empty);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AzureBlobOperator"/> class.
 /// Host=CustomizeHost;Region=Region;Account=AccountName,Token=AccountKey;Protocol=https/http
 /// </summary>
 /// <param name="endpoint">The endpoint.</param>
 public AzureBlobOperator(AzureBlobEndpoint endpoint)
     : this(endpoint.ToCloudStorageAccount())
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AzureQueueOperator{T}" /> class.
 /// Host=CustomizeHost;Region=Region;Account=AccountName,Token=AccountKey;Protocol=https/http
 /// </summary>
 /// <param name="endpoint">The endpoint.</param>
 /// <param name="queueName">Name of the queue.</param>
 /// <param name="encodeMessage">if set to <c>true</c> [encode message].</param>
 public AzureQueueOperator(AzureBlobEndpoint endpoint, string queueName, bool encodeMessage)
     : this(endpoint.ToCloudStorageAccount(), queueName, encodeMessage)
 {
 }
Example #4
0
 /// <summary>
 /// To the cloud storage account.
 /// </summary>
 /// <param name="endpoint">The endpoint.</param>
 /// <returns>Microsoft.WindowsAzure.Storage.CloudStorageAccount.</returns>
 public static CloudStorageAccount ToCloudStorageAccount(this AzureBlobEndpoint endpoint)
 {
     return(ToCloudStorageAccount(endpoint, endpoint.Region));
 }