DistributedCache.AzureTableStorage
2.2.1-preview
This is a prerelease version of DistributedCache.AzureTableStorage.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package DistributedCache.AzureTableStorage --version 2.2.1-preview
NuGet\Install-Package DistributedCache.AzureTableStorage -Version 2.2.1-preview
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="DistributedCache.AzureTableStorage" Version="2.2.1-preview" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DistributedCache.AzureTableStorage" Version="2.2.1-preview" />
<PackageReference Include="DistributedCache.AzureTableStorage" />
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 DistributedCache.AzureTableStorage --version 2.2.1-preview
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DistributedCache.AzureTableStorage, 2.2.1-preview"
#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.
#addin nuget:?package=DistributedCache.AzureTableStorage&version=2.2.1-preview&prerelease
#tool nuget:?package=DistributedCache.AzureTableStorage&version=2.2.1-preview&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DistributedCache.AzureTableStorage
- Based on oceanweb/azuretablestoragecache but with lower dependencies.
- Extra added logic to use strongly typed objects with IDistributedCache instead of byte arrays.
- Multiple versions are available, see table below for details.
Code example
Configure in code (option 1)
c# code:
// Configure in code
services.Configure<AzureTableStorageCacheOptions>(options =>
{
options.TableName = "CacheTest";
options.PartitionKey = "ConsoleApp";
options.ConnectionString = "UseDevelopmentStorage=true;";
options.ExpiredItemsDeletionInterval = TimeSpan.FromHours(24);
});
Notes
- If the TableName does not exists, it's created. If you want to disable this behaviour, set the
options.CreateTableIfNotExists
tofalse
. - When an item is retrieved or added to to the cache, a periodic interval scan can be done to find and delete expired items in the cache. Default this is set to
null
, which means that this functionality is disabled. If you want to change this, set theoptions.ExpiredItemsDeletionInterval
to a different value, likeTimeSpan.FromMinutes(30)
.
Configure via appsettings.json (option 2)
appsettings.json:
"AzureTableStorageCacheOptions": {
"ConnectionString": "UseDevelopmentStorage=true;",
"TableName": "CacheTest",
"PartitionKey": "ConsoleApp"
}
c# code:
// Configure via app.setttings
services.Configure<AzureTableStorageCacheOptions>(Configuration.GetSection("AzureTableStorageCacheOptions"));
Add DistributedAzureTableStorageCache to services
services.AddDistributedAzureTableStorageCache();
Usage
IDistributedCache cache = ... // injected via DI
var test = new TestModel
{
Id = 1,
Name = "Test 1"
};
// Set an item in the cache using an expiration from 30 seconds
var cacheOptions = new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(30) };
await cache.SetAsync("t1", test, cacheOptions);
// Retrieve the item from the cache
var t2 = await cache.GetAsync<TestModel>("t1");
logger.LogInformation("t2 : {TestModel}", JsonConvert.SerializeObject(t2));
Sponsors
Entity Framework Extensions and Dapper Plus are major sponsors and proud to contribute to the development of DistributedCache.AzureTableStorage.
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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.Extensions.Caching.Abstractions (>= 2.1.1)
- MicrosoftAzureCosmosTable.Extensions (>= 2.0.0-preview-00)
- Newtonsoft.Json.Bson (>= 1.0.3)
- Stef.Validation.Options (>= 0.2.0)
-
.NETStandard 2.1
- Microsoft.Extensions.Caching.Abstractions (>= 2.1.1)
- MicrosoftAzureCosmosTable.Extensions (>= 2.0.0-preview-00)
- Newtonsoft.Json.Bson (>= 1.0.3)
- Stef.Validation.Options (>= 0.2.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DistributedCache.AzureTableStorage:
Package | Downloads |
---|---|
DataFunc.IMemoryCache.AzureTableStorage
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
3.3.1 | 754 | 6/17/2025 |
3.3.0 | 26,746 | 12/2/2024 |
3.2.0 | 106,978 | 5/10/2023 |
3.1.0 | 22,616 | 10/21/2022 |
3.1.0-preview-02 | 201 | 10/21/2022 |
3.1.0-preview-01 | 218 | 10/20/2022 |
3.0.1 | 10,611 | 7/12/2022 |
3.0.0-preview-01 | 179 | 6/18/2022 |
2.2.1 | 137 | 6/17/2025 |
2.2.1-preview | 126 | 6/17/2025 |
2.2.0 | 319 | 5/10/2023 |
2.2.0-preview | 273 | 5/10/2023 |
2.1.0 | 1,129 | 10/21/2022 |
2.1.0-preview | 180 | 10/21/2022 |
2.0.1 | 32,913 | 2/5/2021 |
2.0.1-preview | 290 | 2/5/2021 |
2.0.0 | 10,132 | 6/12/2020 |
2.0.0-preview-03 | 375 | 6/10/2020 |
2.0.0-preview-02 | 543 | 5/25/2020 |
2.0.0-preview-01 | 4,461 | 2/28/2020 |
1.2.1 | 129 | 6/17/2025 |
1.2.0 | 412 | 10/21/2022 |
1.1.0 | 1,449 | 6/12/2020 |
1.0.4 | 3,999 | 9/13/2019 |
1.0.3 | 1,042 | 2/15/2019 |
1.0.2 | 701 | 2/13/2019 |
1.0.1 | 721 | 2/9/2019 |
1.0.0 | 746 | 2/8/2019 |
1.0.0-preview-01 | 590 | 2/8/2019 |
See CHANGELOG.md