Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions FluentStorage.Azure.Blobs/Factory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@ public static IModulesFactory UseAzureBlobStorage(this IModulesFactory factory)
return factory.Use(new Module());
}

/// <summary>
/// Creates Azure Blob Storage from an existing <see cref="BlobServiceClient"/>.
/// </summary>
public static IAzureBlobStorage AzureBlobStorage(this IBlobStorageFactory factory,
BlobServiceClient blobServiceClient) {
return AzureBlobStorage(factory, blobServiceClient, null);
}

/// <summary>
/// Creates Azure Blob Storage from an existing <see cref="BlobServiceClient"/>.
/// </summary>
public static IAzureBlobStorage AzureBlobStorage(this IBlobStorageFactory factory,
BlobServiceClient blobServiceClient,
string containerName) {
if (blobServiceClient is null) {
throw new ArgumentNullException(nameof(blobServiceClient));
}

return new AzureBlobStorage(blobServiceClient, blobServiceClient.AccountName, containerName: containerName);
}

/// <summary>
/// Connect to local emulator
/// </summary>
Expand Down