ArturRios.Data.DynamoDb 1.0.3

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

ArturRios.Data.DynamoDb

NuGet Docs License: MIT

An AWS DynamoDB store for the ArturRios.Data toolkit — the same enveloped repository style as the rest of the family, over the AWS SDK's object-persistence model.

Every operation returns a DataOutput / ProcessOutput envelope, so infrastructure failures — including optimistic-concurrency conflicts — surface as errors on the result instead of unhandled exceptions.

This package is standalone (no relational core) and async-only, matching the DynamoDB SDK.

Installation

dotnet add package ArturRios.Data.DynamoDb

Requires .NET 10.0 or later.

Quick start

1. Define an item POCO using the AWS attributes:

using Amazon.DynamoDBv2.DataModel;

[DynamoDBTable("products")]
public class Product
{
    [DynamoDBHashKey]  public string Category { get; set; } = string.Empty;
    [DynamoDBRangeKey] public string Sku { get; set; } = string.Empty;

    public string Name { get; set; } = string.Empty;
    public decimal Price { get; set; }

    [DynamoDBVersion] public int? Version { get; set; }   // optional optimistic concurrency
}

2. Configure (appsettings.json, default section "ArturRios.Data.DynamoDb"):

{
  "ArturRios.Data.DynamoDb": {
    "Region": "us-east-1"
  }
}

For DynamoDB Local or LocalStack, set ServiceUrl instead — dummy credentials are supplied automatically when you don't pass any:

{
  "ArturRios.Data.DynamoDb": {
    "ServiceUrl": "http://localhost:8000",
    "Region": "us-east-1"
  }
}

Leaving both Region and the keys unset defers to the AWS SDK's default resolution chain (environment, profile, instance metadata) — the usual choice on EC2, ECS, or Lambda.

3. Register (Program.cs):

using ArturRios.Data.DynamoDb.DependencyInjection;

builder.Services.AddDynamoData(builder.Configuration);

There is also an AddDynamoData(DynamoOptions) overload if you'd rather build the options yourself.

4. Inject and use:

using ArturRios.Data.DynamoDb.Interfaces;
using ArturRios.Output;

public class ProductService(IAsyncDynamoRepository<Product> repo)
{
    public async Task<Product?> GetAsync(string category, string sku, CancellationToken ct = default)
    {
        DataOutput<Product?> result = await repo.LoadAsync(category, sku, ct);
        return result.Success ? result.Data : null;
    }

    public async Task<IEnumerable<Product>> InCategoryAsync(string category, CancellationToken ct = default)
    {
        var result = await repo.QueryAsync(category, ct);
        return result.Success ? result.Data : [];
    }
}

Repository surface

Method Purpose
SaveAsync(item) put (create or replace) an item
LoadAsync(hashKey) / LoadAsync(hashKey, rangeKey) load by key, or a successful null when not found
DeleteAsync(item) delete (idempotent)
QueryAsync(hashKey) all items with a partition key
QueryAsync(hashKey, op, sortKeyValues) partition key plus a sort-key condition
ScanAsync(conditions) full-table scan — use sparingly
SaveManyAsync / DeleteManyAsync / LoadManyAsync batch operations

All are async and take an optional CancellationToken.

Optimistic concurrency

Add a [DynamoDBVersion] property to opt in. Single-item SaveAsync and DeleteAsync then use a conditional write, and a concurrent modification returns an error on the envelope.

Batch operations bypass version checks. DynamoDB's batch-write API has no conditional-write support, so SaveManyAsync and DeleteManyAsync do not enforce [DynamoDBVersion]. Use the single-item methods where concurrency matters.

Documentation

Licensed under the MIT License.

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.0.3 37 7/24/2026
1.0.2 38 7/23/2026
1.0.1 89 7/15/2026
1.0.0 94 7/15/2026