Pdsr.Cache.SqlServer
3.0.3
See the version list below for details.
dotnet add package Pdsr.Cache.SqlServer --version 3.0.3
NuGet\Install-Package Pdsr.Cache.SqlServer -Version 3.0.3
<PackageReference Include="Pdsr.Cache.SqlServer" Version="3.0.3" />
paket add Pdsr.Cache.SqlServer --version 3.0.3
#r "nuget: Pdsr.Cache.SqlServer, 3.0.3"
// Install Pdsr.Cache.SqlServer as a Cake Addin #addin nuget:?package=Pdsr.Cache.SqlServer&version=3.0.3 // Install Pdsr.Cache.SqlServer as a Cake Tool #tool nuget:?package=Pdsr.Cache.SqlServer&version=3.0.3
Pdsr Cache Helper
A helper library (wrapper) for caching with Redis, MSSQL, ...
What is it?
I have started building several libraries to keep up with the DRY principle, one of them was this lib, helping me to use cache systems.
The first goal this library is keeping Cache requests in one go so I don't have to check if the cache exists, if the cache time has passed, etc.
Getting Started
you need to install the package, add to DI and then use it in services.
- install the package
dotnet add package Pdsr.Cache.Redis
for Redis. - Add the
RedisCacheManager
to DI through the extensionAddRedisCacheManager(c => c.Endpoints = "my-redis:6379")
- Instantiate the
ICacheManager
in your controller or service. - Use any of the Get,Set, ... methods. Async or Sync.
public class MyClass
{
private readonly ICacheManager _cache;
public MyClass(ICacheManager cache) => _cache = cache;
public async Task SomeMethod(CancellationToken cancellationToken = default)
{
var results = await _cache.GetAsync<SomeModel>(
"some-key" , // cache key identifier
async () => // Func<Task<T>> to produce something
{
var model = new SomeModel(); // produce something time consuming
return model;
},
60, // cache time
cancellationToken);
return results;
}
}
Contribute
Please refer to contribute. Some parts definitely needs help.
Documents
Under Creation.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. 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 | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.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. |
-
.NETCoreApp 3.1
- Microsoft.Extensions.Caching.SqlServer (>= 6.0.4)
- Pdsr.Cache (>= 3.0.3)
- System.Linq.Async (>= 6.0.1)
- System.Text.Json (>= 6.0.3)
-
.NETStandard 2.0
- Microsoft.Extensions.Caching.SqlServer (>= 6.0.4)
- Pdsr.Cache (>= 3.0.3)
- System.Linq.Async (>= 6.0.1)
- System.Text.Json (>= 6.0.3)
-
.NETStandard 2.1
- Microsoft.Extensions.Caching.SqlServer (>= 6.0.4)
- Pdsr.Cache (>= 3.0.3)
- System.Linq.Async (>= 6.0.1)
- System.Text.Json (>= 6.0.3)
-
net5.0
- Microsoft.Extensions.Caching.SqlServer (>= 6.0.4)
- Pdsr.Cache (>= 3.0.3)
- System.Linq.Async (>= 6.0.1)
- System.Text.Json (>= 6.0.3)
-
net6.0
- Microsoft.Extensions.Caching.SqlServer (>= 6.0.4)
- Pdsr.Cache (>= 3.0.3)
- System.Linq.Async (>= 6.0.1)
- System.Text.Json (>= 6.0.3)
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.5.1 | 88 | 10/9/2024 |
3.5.1-beta.1 | 44 | 10/9/2024 |
3.5.0 | 153 | 2/20/2024 |
3.3.1 | 172 | 8/26/2023 |
3.3.0 | 184 | 7/18/2023 |
3.2.1 | 257 | 2/20/2023 |
3.2.0 | 344 | 11/11/2022 |
3.1.8 | 400 | 9/13/2022 |
3.0.7 | 417 | 8/25/2022 |
3.0.6 | 423 | 6/21/2022 |
3.0.5 | 481 | 5/11/2022 |
3.0.4 | 453 | 4/18/2022 |
3.0.3 | 462 | 4/18/2022 |
3.0.2 | 453 | 4/18/2022 |
3.0.1.303 | 428 | 4/17/2022 |
3.0.1.301 | 436 | 4/17/2022 |