PouryaKit.Storage 0.1.0-preview.2

This is a prerelease version of PouryaKit.Storage.
dotnet add package PouryaKit.Storage --version 0.1.0-preview.2
                    
NuGet\Install-Package PouryaKit.Storage -Version 0.1.0-preview.2
                    
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="PouryaKit.Storage" Version="0.1.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PouryaKit.Storage" Version="0.1.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="PouryaKit.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 PouryaKit.Storage --version 0.1.0-preview.2
                    
#r "nuget: PouryaKit.Storage, 0.1.0-preview.2"
                    
#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 PouryaKit.Storage@0.1.0-preview.2
                    
#: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=PouryaKit.Storage&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=PouryaKit.Storage&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Tool

PouryaKit.Storage

NuGet .NET 10 License: MIT

PouryaKit.Storage

One file storage contract for Feature code. IFileStorage uploads a stream under a key, downloads it, deletes it, and gives a presigned link that reads it without credentials until it expires. Every call is cancellable and returns a Result for what a Feature expects, so a missing file is an Error, never an exception, and Feature code never names a cloud SDK. A failure of the store itself throws.

Install

dotnet add package PouryaKit.Storage --prerelease

When to use it

  • A Feature stores a file, downloads it or deletes it under a key.
  • A browser or another system needs a time-limited link to read a file.
  • A command records a stored file's key, and a failed command must not leave a record of a missing file.

A provider package supplies the Host's one implementation: PouryaKit.Storage.S3 for S3 and S3-compatible stores, or PouryaKit.Storage.AzureBlob for Azure Blob Storage.

Quick start

Inject IFileStorage where a Feature handles a file. From the Kit's tests, an upload and its download:

var key = Key();
Assert.True(
    (
        await fixture.Storage.UploadAsync(
            key,
            new MemoryStream(Report),
            "application/pdf",
            Cancel
        )
    ).IsSuccess
);

var download = await fixture.Storage.DownloadAsync(key, Cancel);
await using var file = download.Value;

What you get

  • One contract on every provider, so Feature code is the same on either.
  • A Result for each expected outcome, with a missing file as StorageErrors.FileNotFound, and an exception for a failure of the store itself.
  • Presigned links with a lifetime you choose.
  • A Host that fails when it is built unless it composes exactly one provider.

A file is never part of the commit. Store the file first, under a fresh key, and only then record the key in the command's state. A command that fails after the upload leaves an object no record names, which your application's retention removes.

Learn more

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 (3)

Showing the top 3 NuGet packages that depend on PouryaKit.Storage:

Package Downloads
PouryaKit.Reporting.Module

The Kit's report Module: report jobs generated in the background, stored through the Host's file storage and served to their requester by a time-limited link.

PouryaKit.Storage.S3

The Host's file storage on Amazon S3 or an S3-compatible store such as MinIO, on the AWS SDK, from validated options.

PouryaKit.Storage.AzureBlob

The Host's file storage on Azure Blob Storage, from validated options, behind the one file storage contract.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.2 80 11/1/2026
0.1.0-preview.1 77 10/31/2026
0.1.0-preview.0.28 81 10/26/2026