Simple content store abstraction.
dotnet add package Shuttle.ContentStoreRegister a content store implementation using the AddContentStore() builder:
services.AddContentStore()
.UseAzure(options =>
{
options.ConnectionString = "UseDevelopmentStorage=true";
options.ContainerName = "content-store";
});The Azure implementation requires the Shuttle.ContentStore.Azure package, and can be tested locally against the Azurite emulator.
Once registered, resolve IContentStore (or a specific keyed store, e.g. [FromKeyedServices("azure")]) to read and write content:
await contentStore.PutAsync("path/to/file.txt", stream);
await using var content = await contentStore.OpenReadAsync("path/to/file.txt");