SoftwareDriven.Persistence.S3 3.1.0

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

SoftwareDriven.Persistence.S3

S3-compatible object storage provider for SoftwareDriven.Persistence. Works with AWS S3 and S3-compatible servers such as MinIO. Targets net10.0.

Installation

dotnet add package SoftwareDriven.Persistence.S3

Setup

// Register services
services.AddS3();
services.AddSingleton<S3RepositoryProvider<MyModel>>();

// Connect against AWS S3
var manager = serviceProvider.GetRequiredService<S3Manager>();
await manager.Connect("accessKey", "secretKey", "eu-central-1", "my-bucket");

S3-compatible endpoint (e.g. MinIO)

await manager.ConnectToEndpoint("http://localhost:9000", "minioadmin", "minioadmin", "my-bucket");

A MinIO instance for local development or for running the tests of this repository:

docker run -d --name sd-persistence-minio -p 9000:9000   -e MINIO_ROOT_USER=minioadmin -e MINIO_ROOT_PASSWORD=minioadmin   quay.io/minio/minio:latest server /data

The endpoint, the credentials and the bucket the tests use are configured in the S3 section of SoftwareDriven.Persistence.Test/appsettings.json.

Pre-configured client

await manager.Connect(myAmazonS3Client, "my-bucket");

Multi-instance (keyed DI)

services.AddS3("InstanceA");
services.AddS3("InstanceB");

var managerA = serviceProvider.GetRequiredKeyedService<S3Manager>("InstanceA");
var managerB = serviceProvider.GetRequiredKeyedService<S3Manager>("InstanceB");

Usage

var provider = serviceProvider.GetRequiredService<S3RepositoryProvider<MyModel>>();

// CRUD
await provider.CreateOrUpdate(new MyModel { Title = "Hello" });
var item = await provider.FindById("some-id");
var results = await provider.FindByExpression(x => x.Title == "Hello");
await provider.Delete("some-id");

// Files
await provider.StoreFile("logo.png", bytes);
var data = await provider.LoadFile("logo.png");

// Pagination
var page = await provider.GetAll(new PaginationOptions<MyModel>
{
    PageSize = 10,
    PageNumber = 0
});

Storage layout

Each model type is stored as a single JSON object in the bucket under {BasePath}/{TableName}.json (default BasePath is data). Files stored via IFileProvider are kept as individual objects under {BasePath}/files/{FileFolder}/{fileId}.

Queries are executed in memory after loading the collection object. This keeps the full IPersistenceProvider<T> contract (expression queries, projections, element match) available, but is best suited for small to medium collections. Read-modify-write on a collection is not atomic across concurrent writers.

Features

  • SupportsTotalCount: true
  • SupportsPagingState: false (offset-based pagination)
  • DefaultIdSource: GuidSource
  • SupportsMaintenance: false (a deleted object is gone; there is nothing to compact)
  • Full IPersistenceProvider<T> support including nested collection projections and element match queries

License

MIT

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
3.1.0 36 8/25/2026