Katalyst.App.Storage 1.2.1

dotnet add package Katalyst.App.Storage --version 1.2.1
                    
NuGet\Install-Package Katalyst.App.Storage -Version 1.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Katalyst.App.Storage" Version="1.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Katalyst.App.Storage" Version="1.2.1" />
                    
Directory.Packages.props
<PackageReference Include="Katalyst.App.Storage" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Katalyst.App.Storage --version 1.2.1
                    
#r "nuget: Katalyst.App.Storage, 1.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Katalyst.App.Storage@1.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Katalyst.App.Storage&version=1.2.1
                    
Install as a Cake Addin
#tool nuget:?package=Katalyst.App.Storage&version=1.2.1
                    
Install as a Cake Tool

App.Storage

Vendor-agnostic object storage for .NET: upload, open, delete, and existence checks via IFileStorage, with built-in Amazon S3 and Azure Blob Storage providers. Streams are used end-to-end (from a web app, pass IFormFile.OpenReadStream() when uploading).

This project is not referenced by the rest of the WebTemplate by default; add a PackageReference to Katalyst.App.Storage or a ProjectReference when you adopt it.

Packages

Registration

Use AddAppStorage and pick one of UseAmazonS3, UseAzureBlob, or UseCustom. The configuration section names below match AppStorageOptions.SectionName ("Storage") plus a provider key.

using App.Storage.DependencyInjection;

builder.Services.AddAppStorage(builder.Configuration, storage =>
{
    storage.UseAmazonS3(builder.Configuration.GetSection("Storage:AmazonS3"));
    // or: storage.UseAzureBlob(builder.Configuration.GetSection("Storage:AzureBlob"));
});

Inject IFileStorage where you need to read or write objects.

Example appsettings.json (Amazon S3)

{
  "Storage": {
    "AmazonS3": {
      "BucketName": "my-app-uploads",
      "Prefix": "uploads",
      "Region": "us-east-1"
    }
  }
}

Region is optional (defaults to us-east-1). Prefix is optional and prepended to every object key.

Example appsettings.json (Azure Blob)

{
  "Storage": {
    "AzureBlob": {
      "ConnectionString": "UseDevelopmentStorage=true;",
      "ContainerName": "uploads",
      "Prefix": "files"
    }
  }
}

Ensure the container exists (or create it out of band); the library does not create the container automatically.

Usage

using App.Storage.Contracts;

public class MyService(IFileStorage files)
{
    public async Task SaveAsync(string key, Stream content, CancellationToken ct)
    {
        await files.UploadAsync(key, content, contentType: "application/pdf", ct);
    }

    public async Task<Stream> LoadAsync(string key, CancellationToken ct)
    {
        return await files.OpenReadAsync(key, ct); // dispose the stream when done
    }

    public Task DeleteAsync(string key, CancellationToken ct) => files.DeleteAsync(key, ct);

    public Task<bool> ExistsAsync(string key, CancellationToken ct) => files.ExistsAsync(key, ct);
}

Custom provider

Implement IFileStorage and register:

services.AddAppStorage(configuration, storage => storage.UseCustom<MyFileStorage>());
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.1 134 4/29/2026
1.2.0 119 4/23/2026
1.1.0 121 4/14/2026