Ejemplo n.º 1
0
        public AgentController()
        {
            //Initialize the Azure Storage first so the repository has what it needs to access the Blob Storage
            // Open storage account using credentials from .cscfg file.
            var storageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("StorageConnectionString"));

            // Get context object for working with blobs, and 
            // set a default retry policy appropriate for a web user interface.
            var blobClient = storageAccount.CreateCloudBlobClient();
            blobClient.DefaultRequestOptions.RetryPolicy = new LinearRetry(TimeSpan.FromSeconds(3), 3);

            // Get a reference to the blob container.
            CloudBlobContainer imagesBlobContainer = blobClient.GetContainerReference("images");

            // Get context object for working with queues, and 
            // set a default retry policy appropriate for a web user interface.
            CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();
            queueClient.DefaultRequestOptions.RetryPolicy = new LinearRetry(TimeSpan.FromSeconds(3), 3);

            // Get a reference to the queue.
            CloudQueue imagesQueue = queueClient.GetQueueReference("images");

            //Instantiate a repository of type Agent
            _repository = new TCWAdminRepository<Agent>(imagesBlobContainer, imagesQueue);
        }
 public FeaturedPropertyController()
 {
     _repository = new TCWAdminRepository<FeaturedProperty>();
 }
 public ContactInfoController()
 {
     _repository = new TCWAdminRepository<ContactInfo>();
 }