title: Dependency Injection on a class instantiation of a sealed class
body: <p>I'm currently trying to build a sealed class that gets the configuration of the azure storage via settings stored in a JSON. I register the settings in the startup.cs class, and then inject it to the constructor. The problem is when I need to initiate the same class within the class because its a sealed class</p>
  
  <pre><code>public sealed class AzureFileStorage
  {
      private static volatile AzureFileStorage instance;
      private static object syncRoot = new Object();
      private readonly AzureBlobSettings _azureBlobSettings;
  
      public CloudStorageAccount StorageAccount { get; private set; }
      public CloudBlobClient BlobClient { get; private set; }
      public CloudBlobContainer Container { get; private set; }
  
      public AzureFileStorage(IOptions&lt;AzureBlobSettings&gt; fbAuthSettingsAccessor)
      {
          _azureBlobSettings = fbAuthSettingsAccessor.Value;
          StorageAccount = CloudStorageAccount.Parse(_azureBlobSettings.BlobStorageConnectionString);
  
          //instantiate the client
          BlobClient = StorageAccount.CreateCloudBlobClient();
  
          //set the container
          Container = BlobClient.GetContainerReference(_azureBlobSettings.ContainerBlobAzureId);
  
      }
  
      public static AzureFileStorage Instance
      {
          get
          {
              if (instance == null)
              {
                  lock (syncRoot)
                  {
  
                      if (instance == null)
                          instance = new AzureFileStorage(????);
                  }
              }
  
              return instance;
          }
      }
  }
  </code></pre>
  
  <p>How do I initiaze azurefilestorage, if the azureblobsettings are being passed via dependency injection.</p>