PouryaKit.Storage
0.1.0-preview.2
dotnet add package PouryaKit.Storage --version 0.1.0-preview.2
NuGet\Install-Package PouryaKit.Storage -Version 0.1.0-preview.2
<PackageReference Include="PouryaKit.Storage" Version="0.1.0-preview.2" />
<PackageVersion Include="PouryaKit.Storage" Version="0.1.0-preview.2" />
<PackageReference Include="PouryaKit.Storage" />
paket add PouryaKit.Storage --version 0.1.0-preview.2
#r "nuget: PouryaKit.Storage, 0.1.0-preview.2"
#:package PouryaKit.Storage@0.1.0-preview.2
#addin nuget:?package=PouryaKit.Storage&version=0.1.0-preview.2&prerelease
#tool nuget:?package=PouryaKit.Storage&version=0.1.0-preview.2&prerelease

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
Resultfor each expected outcome, with a missing file asStorageErrors.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 | Versions 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. |
-
net10.0
- PouryaKit.Cqrs (>= 0.1.0-preview.2)
- PouryaKit.Domain (>= 0.1.0-preview.2)
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 |