Chd.Library.Caching
7.4.4
See the version list below for details.
dotnet add package Chd.Library.Caching --version 7.4.4
NuGet\Install-Package Chd.Library.Caching -Version 7.4.4
<PackageReference Include="Chd.Library.Caching" Version="7.4.4" />
paket add Chd.Library.Caching --version 7.4.4
#r "nuget: Chd.Library.Caching, 7.4.4"
// Install Chd.Library.Caching as a Cake Addin #addin nuget:?package=Chd.Library.Caching&version=7.4.4 // Install Chd.Library.Caching as a Cake Tool #tool nuget:?package=Chd.Library.Caching&version=7.4.4
Caching library for .Net Core
📝 Table of Contents
🧐 About
I'm computer engineer for 13 years. I wrote this package for caching asp.net core application. This caching machenism is use aspects for sipmlfy code.
🏁 Getting Started
Caching is an important feature that reduces database usage. This package is very simple to use with aspect oriented programming.
Prerequisites
You must use .net core 6.0 or higher
Installing
dotnet add package Chd.Library.Caching --version 1.4.2
🔧 Running the tests
[TestClass]
public class CachingTests
{
static CachingTests()
{
CachingDependenyInjectionExtensions.UseRedis(null);
}
[TestMethod]
public void Test()
{
int a = 4;
Sum(2, 0);
Sum(2, 0);
}
[Cache(60)]
public int Sum(int a, int b)
{
return a + b;
}
}
You must add below code in appsettings.json
"Redis":
{
"Url": "x.x.x.x:pppp"//redis server ip and port
}
Test Result
Add break point in to Sum method. You will see only one times broke down into method. Other call is brought from redis server.
🎈 Usage
Firtly you must call UseRedis method ("app.UseRedis();") in the program.cs file. You must use Cache attribute on method whice you want to cache return value of method. Cache attribute takes a parameter that cache time in seconds
⛏️ Built Using
- Redis - Redis server
✍️ Authors
- @yoldasmehmet - Idea & Initial work
See also the list of contributors who participated in this project.
🎉 Acknowledgements
Thank you for using my library.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. |
-
net7.0
- Chd.Library.Common (>= 7.3.9)
- MethodBoundaryAspect.Fody (>= 2.0.149)
- Serilog.Settings.Configuration (>= 7.0.0)
- StackExchange.Redis (>= 2.6.122)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.