CacheLiteSharp 6.0.0

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

// Install CacheLiteSharp as a Cake Tool
#tool nuget:?package=CacheLiteSharp&version=6.0.0                

logo Build Status

📂 A variety of cache implementations, all in .NET Core C#

Primarily influenced by the Kotlin-based Cache-Lite over at Kid the Programmer

Cache implementations include Perpetual, Least Recently Used, and Expirable.

This is mainly an academic exercise, however, feel entirely free to use this class library in your own projects, and please let me know the results of said attempt. This library comes in a handy nuget package for the bold in question.

Installation

PM> Install-Package CacheLiteSharp.Core -Version 6.0.0   

Interface

All caches in this library implement the following simplistic interface, with slight variations on flush strategy inherent to said implementation:

    public interface ICache<T> where T : class
    {
        /// <summary>
        /// Obtain the size of the Cache in integer form
        /// </summary>
        int Size { get; }

        /// <summary>
        /// Set a generic cache value based on a string key 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        void Set(string key, T value);

        /// <summary>
        /// Get a particular cache value using a string key
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        T Get(string key);

        /// <summary>
        /// Remove a particular cache value using a string key
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        T Remove(string key);

        /// <summary>
        /// Clear the entire cache
        /// </summary>
        void Clear();
    }
Product Compatible and additional computed target framework versions.
.NET 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. 
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
6.0.1 831 10/16/2022
6.0.0 884 10/13/2022
1.0.0 1,412 7/18/2018