Helper classes to connect to Microsoft Azure Blob- and Table-Storage
Version 1.x of this package is supporting Windows.Azure.Storage untill version 9.3.3. As of version 9.4.0 that particular package has been split into multiple smaller packages.
This version won't be maintained anymore!
Version 2.x of this package supports the following microsoft packages;
- Microsoft.Azure.Storage.Blob
- Microsoft.Azure.Storage.Queue
- Microsoft.Azure.Cosmos.Table
Version 3.3.x introduces a breaking change!
The following methods have been changed;
- Task<Response> Retrieve was changed to Task<Response> GetSingle
- AsyncPageable Retrieve was changed to AsyncPageable Query (including all overloads!)
There are two options to use this library. You can either get the storagefactory from the DI-container. This is useful when you need the factory multiple times to give you an TableStorage-, BlobStorage or QueueManager. The other way is to add a little more code in your startup to directly get one of managers directly in your implementation.
Both options are explained here.
-
In your startup.cs add the following line of code;
services.AddStorageFactory(); -
On your implementation side you can do something like this:
public class MyClass{ private readonly ITableStorageManager _tableStorageManager; public MyClass(IStorageFactory storageFactory){ _tableStorageManager = storageFactory.GetTableStorageManager("myConnectionString","myTableName") } }
-
In your startup.cs add the following line of code;
services.AddTableStorageManager("myConnectionString","myTableName"); -
On your implementation side you can use one of the options below
public class MyClass{ private readonly ITableStorageManager _tableStorageManager; public MyClass(ITableStorageManager tableStorageManager){ _tableStorageManager = tableStorageManager; } }
-
In your startup.cs add the following line of code;
services.AddBlobStorageManager("storageUrl","accountName", "accessKey");OR
services.AddBlobStorageManager("connectionstring"); -
On your implementation side you can use one of the options below
public class MyClass{ private readonly IBlobStorageMaanger _blobStorageManager; public MyClass(IBlobStorageMaanger blobStorageManager){ _tableStorageManager = blobStorageManager; } }
-
In your startup.cs add the following line of code;
services.AddQueueManager("connectionString", "queueName"); -
On your implementation side you can use one of the options below
public class MyClass{ private readonly IQueueManager _queueManager; public MyClass(IQueueManager queueManager){ _queueManager = queueManager; } }