Net.Cache.DynamoDb
1.3.5
dotnet add package Net.Cache.DynamoDb --version 1.3.5
NuGet\Install-Package Net.Cache.DynamoDb -Version 1.3.5
<PackageReference Include="Net.Cache.DynamoDb" Version="1.3.5" />
paket add Net.Cache.DynamoDb --version 1.3.5
#r "nuget: Net.Cache.DynamoDb, 1.3.5"
// Install Net.Cache.DynamoDb as a Cake Addin #addin nuget:?package=Net.Cache.DynamoDb&version=1.3.5 // Install Net.Cache.DynamoDb as a Cake Tool #tool nuget:?package=Net.Cache.DynamoDb&version=1.3.5
Net.Cache.DynamoDb
Overview
Net.Cache.DynamoDb extends the capabilities of the Net.Cache library by integrating with Amazon DynamoDB. This integration allows for the use of DynamoDB as a distributed, scalable, and highly available backend for caching operations.
Features
DynamoDB Integration
: Leverages Amazon DynamoDB for storing and retrieving cache data.Easy Configuration
: Offers various initialization methods for the DynamoDB client.Seamless Compatibility
: Fully compatible with the Net.Cache library, providing DynamoDB as a storage option.
Getting Started
Installation
Install Net.Cache.DynamoDb via NuGet along with Net.Cache
Defining DynamoDB Models
To use DynamoDbStorageProvider
, you need to define models representing your DynamoDB tables:
using Amazon.DynamoDBv2.DataModel;
[DynamoDBTable("MyTableName")]
public class MyTable
{
[DynamoDBHashKey] // Partition key
public string Id { get; set; }
[DynamoDBProperty("MyCustomNameIfNeeded")] // Optional custom property name
public string SomeProperty { get; set; }
// Other properties as needed
}
Usage
Initializing DynamoDbStorageProvider
Create an instance of DynamoDbStorageProvider<TKey, TValue>
using one of the following methods:
- Default Initialization:
var dynamoDbProvider = new DynamoDbStorageProvider<int, MyTable>();
- Custom DynamoDB Client:
var customClient = new AmazonDynamoDBClient(...);
var dynamoDbProvider = new DynamoDbStorageProvider<int, MyTable>(customClient);
- Custom DynamoDB Context:
var customContext = new DynamoDBContext(customClient);
var dynamoDbProvider = new DynamoDbStorageProvider<int, MyTable>(customContext);
Integrating with Net.Cache
var cache = new CacheProvider<int, MyTable>(dynamoDbProvider);
Storing and Retrieving Data
// Store a value
cache.Store(1, new MyTable { Id = "1", SomeProperty = "Value" });
// Retrieve a value
if (cache.TryGetValue(1, out var myTableInstance)) {
// Use myTableInstance
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- AWSSDK.DynamoDBv2 (>= 3.7.301.22)
- Net.Cache (>= 1.3.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Net.Cache.DynamoDb:
Package | Downloads |
---|---|
Net.Cache.DynamoDb.ERC20
A specialized extension of `Net.Cache.DynamoDb` package, for caching ERC20 token information in Amazon DynamoDB. |
GitHub repositories
This package is not used by any popular GitHub repositories.