Chd.Library.Caching 8.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Chd.Library.Caching --version 8.0.0                
NuGet\Install-Package Chd.Library.Caching -Version 8.0.0                
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="Chd.Library.Caching" Version="8.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Chd.Library.Caching --version 8.0.0                
#r "nuget: Chd.Library.Caching, 8.0.0"                
#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.
// Install Chd.Library.Caching as a Cake Addin
#addin nuget:?package=Chd.Library.Caching&version=8.0.0

// Install Chd.Library.Caching as a Cake Tool
#tool nuget:?package=Chd.Library.Caching&version=8.0.0                

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

✍️ Authors

See also the list of contributors who participated in this project.

🎉 Acknowledgements

Thank you for using my library.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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
8.0.1 329 2/3/2024
8.0.0 290 1/30/2024
7.4.4 592 8/9/2023
1.4.4 676 6/15/2023
1.4.3 661 6/13/2023
1.4.2 672 6/13/2023
1.4.1 746 2/12/2023
1.4.0 776 2/11/2023
1.2.7 747 1/30/2023
1.1.3 1,997 1/30/2023