CodeDesignPlus.Net.Cache.Abstractions 0.13.0-beta.12808

This is a prerelease version of CodeDesignPlus.Net.Cache.Abstractions.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package CodeDesignPlus.Net.Cache.Abstractions --version 0.13.0-beta.12808
                    
NuGet\Install-Package CodeDesignPlus.Net.Cache.Abstractions -Version 0.13.0-beta.12808
                    
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="CodeDesignPlus.Net.Cache.Abstractions" Version="0.13.0-beta.12808" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeDesignPlus.Net.Cache.Abstractions" Version="0.13.0-beta.12808" />
                    
Directory.Packages.props
<PackageReference Include="CodeDesignPlus.Net.Cache.Abstractions" />
                    
Project file
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 CodeDesignPlus.Net.Cache.Abstractions --version 0.13.0-beta.12808
                    
#r "nuget: CodeDesignPlus.Net.Cache.Abstractions, 0.13.0-beta.12808"
                    
#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.
#:package CodeDesignPlus.Net.Cache.Abstractions@0.13.0-beta.12808
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CodeDesignPlus.Net.Cache.Abstractions&version=0.13.0-beta.12808&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CodeDesignPlus.Net.Cache.Abstractions&version=0.13.0-beta.12808&prerelease
                    
Install as a Cake Tool

Okay, I'll create a README.md file for the CodeDesignPlus.Net.Cache library, following the structure you've provided and incorporating information relevant to a caching library.

# CodeDesignPlus.Net.Cache

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=CodeDesignPlus.Net.Cache&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=CodeDesignPlus.Net.Cache)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=CodeDesignPlus.Net.Cache&metric=bugs)](https://sonarcloud.io/summary/new_code?id=CodeDesignPlus.Net.Cache)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=CodeDesignPlus.Net.Cache&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=CodeDesignPlus.Net.Cache)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=CodeDesignPlus.Net.Cache&metric=coverage)](https://sonarcloud.io/summary/new_code?id=CodeDesignPlus.Net.Cache)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=CodeDesignPlus.Net.Cache&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=CodeDesignPlus.Net.Cache)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=CodeDesignPlus.Net.Cache&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=CodeDesignPlus.Net.Cache)

## Description

The `CodeDesignPlus.Net.Cache` project provides a flexible and abstract caching layer for .NET applications. It allows you to easily integrate different caching solutions (like Redis, Memcached, or in-memory caches) by using a common interface. This library aims to improve performance by reducing the need to retrieve data from the original source repeatedly.

## Table of Contents

- [About The Project](#about-the-project)
- [Installation](#installation)
- [Usage](#usage)
- [Roadmap](#roadmap)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)

## About The Project

The `CodeDesignPlus.Net.Cache` library is designed to simplify caching in .NET applications by providing an abstraction over various caching implementations. It promotes maintainability and testability through a consistent API.

### Key Features

-   **Abstract Caching Interface (`ICacheManager`):**  Defines a common interface for interacting with different cache providers, supporting asynchronous operations.
-   **Generic Operations:** Supports storing and retrieving any type of data in the cache with type safety using generics.
-   **Asynchronous Operations:** All operations are fully asynchronous, ensuring a non-blocking approach and improving overall performance.
-   **Expiration Control:** Allows setting an expiration time for cached items.
-   **Multiple Cache Provider Implementations:** Designed to easily integrate with various cache providers (e.g. Redis, Memcached, In-Memory, etc.).

## Installation

To install the package, run the following command:

```bash
dotnet add package CodeDesignPlus.Net.Cache

Usage

Here's a basic example of how to use the ICacheManager:

// Assuming you have an instance of ICacheManager (e.g., RedisCacheManager or MemcachedCacheManager)
// through dependency injection

public class MyService
{
    private readonly ICacheManager _cacheManager;

    public MyService(ICacheManager cacheManager)
    {
        _cacheManager = cacheManager;
    }

    public async Task<MyData> GetDataAsync(string key)
    {
        // Try to get the data from cache first
        var cachedData = await _cacheManager.GetAsync<MyData>(key);
        if (cachedData != null)
        {
            return cachedData;
        }

        // If data isn't in cache, fetch from the source
        var data = await GetDataFromSourceAsync(key); // Some function to retrieve data
        
        // Store in cache for future use
        await _cacheManager.SetAsync(key, data, TimeSpan.FromMinutes(10));
        return data;
    }

   // Assume this method return a task with the result
    private async Task<MyData> GetDataFromSourceAsync(string key)
    {
      // Your implementation here
       await Task.Delay(100);
       return new MyData() { Id=key, Name = "Example " + key};
    }
}

// A simple Model
public class MyData {
  public string Id { get; set;}
  public string Name { get; set; }
}

For more detailed information and advanced use cases, please refer to our documentation at CodeDesignPlus Doc.

Roadmap

Refer to issues for a list of proposed features and known issues.

Contributing

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

CodeDesignPlus - @CodeDesignPlus - wliscano@codedesignplus.com

Project Link: CodeDesignPlus.Net.Cache

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on CodeDesignPlus.Net.Cache.Abstractions:

Package Downloads
CodeDesignPlus.Net.Security.Abstractions

CodeDesignPlus.Net.Security.Abstractions provides essential interfaces and abstract classes for implementing security features in .NET Core applications. This library defines core contracts and abstractions that facilitate a clean and maintainable architecture for authentication, authorization, and other security-related tasks, enabling better testing and extensibility.

CodeDesignPlus.Net.Redis.Cache.Abstractions

CodeDesignPlus.Net.Core.Abstractions provides essential interfaces and abstract classes for the CodeDesignPlus.Net.Core library, enabling a clean and maintainable architecture for .NET Core applications. This library defines the core contracts and abstractions that facilitate dependency injection, testing, and extensibility.

CodeDesignPlus.Net.gRpc.Clients

CodeDesignPlus.Net.gRpc.Clients is a library that simplifies the integration of gRPC clients in .NET applications, providing a robust framework for building efficient and scalable gRPC-based services.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.13.0-beta.12822 0 5/18/2026
0.13.0-beta.12816 0 5/18/2026
0.13.0-beta.12815 82 5/17/2026
0.13.0-beta.12808 36 5/17/2026
0.13.0-beta.12770 138 5/16/2026
0.13.0-beta.12769 67 5/16/2026
0.13.0-beta.12768 59 5/16/2026
0.13.0-beta.12767 263 5/14/2026
0.13.0-beta.12766 182 5/1/2026
0.13.0-beta.12765 73 5/1/2026
0.13.0-beta.12762 76 5/1/2026
0.13.0-beta.12761 78 4/30/2026
0.13.0-beta.12760 88 4/30/2026
0.13.0-beta.12759 68 4/26/2026
0.13.0-beta.12758 174 4/26/2026
0.13.0-beta.12757 177 4/25/2026
0.13.0-beta.12756 59 4/25/2026
0.13.0-beta.12755 65 4/25/2026
0.13.0-beta.12754 67 4/24/2026
0.11.0 965 7/23/2025
Loading failed