Example #1
0
        private string GetContainerSafeName(HttpTenantSelector selector)
        {
            string name = selector.Name;

            if (name.Any(c => Char.IsNumber(c)))
            {
                name = "localhost";
            }
            return(name);
        }
Example #2
0
        public AzureBlobRepository(RepositoryKeys keys, HttpTenantSelector tenantSelector)
        {
            _keys           = keys;
            _tenantSelector = tenantSelector;

            var    storage    = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("AzureBlobRepository.ConnectionString"));
            var    blobClient = storage.CreateCloudBlobClient();
            string name       = GetContainerSafeName(tenantSelector);

            _container = blobClient.GetContainerReference(name);
        }
 public JsonRepository(RepositoryKeys keys, HttpTenantSelector tenantSelector)
 {
     _keys           = keys;
     _tenantSelector = tenantSelector;
 }