CodeDesignPlus.Net.Cache.Abstractions
0.6.0
See the version list below for details.
dotnet add package CodeDesignPlus.Net.Cache.Abstractions --version 0.6.0
NuGet\Install-Package CodeDesignPlus.Net.Cache.Abstractions -Version 0.6.0
<PackageReference Include="CodeDesignPlus.Net.Cache.Abstractions" Version="0.6.0" />
<PackageVersion Include="CodeDesignPlus.Net.Cache.Abstractions" Version="0.6.0" />
<PackageReference Include="CodeDesignPlus.Net.Cache.Abstractions" />
paket add CodeDesignPlus.Net.Cache.Abstractions --version 0.6.0
#r "nuget: CodeDesignPlus.Net.Cache.Abstractions, 0.6.0"
#addin nuget:?package=CodeDesignPlus.Net.Cache.Abstractions&version=0.6.0
#tool nuget:?package=CodeDesignPlus.Net.Cache.Abstractions&version=0.6.0
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
[](https://sonarcloud.io/summary/new_code?id=CodeDesignPlus.Net.Cache)
[](https://sonarcloud.io/summary/new_code?id=CodeDesignPlus.Net.Cache)
[](https://sonarcloud.io/summary/new_code?id=CodeDesignPlus.Net.Cache)
[](https://sonarcloud.io/summary/new_code?id=CodeDesignPlus.Net.Cache)
[](https://sonarcloud.io/summary/new_code?id=CodeDesignPlus.Net.Cache)
[](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
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
CodeDesignPlus - @CodeDesignPlus - codedesignplus@outlook.com
Project Link: CodeDesignPlus.Net.Cache
Product | Versions 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. |
-
net9.0
NuGet packages (2)
Showing the top 2 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. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.7.0-beta.33 | 106 | 4 days ago |
0.7.0-beta.32 | 202 | 7 days ago |
0.7.0-beta.31 | 110 | 7 days ago |
0.7.0-beta.30 | 212 | 8 days ago |
0.7.0-beta.29 | 165 | 8 days ago |
0.7.0-beta.28 | 379 | 20 days ago |
0.7.0-beta.27 | 215 | 20 days ago |
0.7.0-beta.26 | 201 | 21 days ago |
0.7.0-beta.25 | 178 | 23 days ago |
0.7.0-beta.24 | 154 | 23 days ago |
0.7.0-beta.23 | 150 | 23 days ago |
0.7.0-beta.22 | 40 | 25 days ago |
0.7.0-beta.21 | 118 | a month ago |
0.7.0-beta.20 | 125 | a month ago |
0.7.0-beta.18 | 111 | a month ago |
0.7.0-beta.17 | 110 | a month ago |
0.7.0-beta.16 | 264 | a month ago |
0.7.0-beta.15 | 225 | a month ago |
0.7.0-beta.11 | 128 | a month ago |
0.7.0-beta.10 | 132 | a month ago |
0.7.0-beta.9 | 136 | a month ago |
0.7.0-beta.8 | 102 | a month ago |
0.7.0-beta.7 | 83 | a month ago |
0.7.0-beta.6 | 146 | a month ago |
0.7.0-beta.5 | 123 | a month ago |
0.7.0-beta.4 | 126 | a month ago |
0.7.0-beta.3 | 127 | a month ago |
0.7.0-beta.2 | 125 | a month ago |
0.6.1-beta.1 | 231 | a month ago |
0.6.0 | 255 | 2 months ago |
0.6.0-rc.29 | 63 | 2 months ago |
0.6.0-beta.29 | 212 | 2 months ago |
0.6.0-beta.28 | 107 | 2 months ago |
0.6.0-beta.26 | 219 | 2 months ago |
0.6.0-beta.22 | 142 | 3 months ago |
0.6.0-beta.21 | 202 | 3 months ago |
0.6.0-beta.20 | 129 | 3 months ago |
0.6.0-beta.18 | 77 | 3 months ago |
0.6.0-beta.15 | 84 | 3 months ago |
0.6.0-beta.10 | 141 | 4 months ago |
0.6.0-beta.9 | 58 | 4 months ago |
0.5.0 | 116 | 4 months ago |
0.5.0-rc.87 | 62 | 4 months ago |
0.5.0-beta.91 | 58 | 4 months ago |
0.5.0-beta.89 | 61 | 4 months ago |
0.5.0-beta.87 | 64 | 4 months ago |
0.5.0-beta.86 | 61 | 4 months ago |
0.5.0-beta.85 | 61 | 4 months ago |
0.5.0-beta.84 | 54 | 4 months ago |
0.5.0-beta.83 | 51 | 4 months ago |
0.5.0-beta.82 | 59 | 4 months ago |
0.5.0-beta.81 | 69 | 4 months ago |
0.5.0-beta.79 | 57 | 4 months ago |
0.5.0-beta.78 | 58 | 4 months ago |
0.5.0-beta.76 | 57 | 4 months ago |
0.5.0-beta.75 | 55 | 4 months ago |
0.5.0-beta.71 | 57 | 4 months ago |
0.5.0-beta.69 | 51 | 5 months ago |
0.5.0-beta.61 | 50 | 5 months ago |
0.5.0-beta.60 | 61 | 5 months ago |
0.5.0-beta.59 | 66 | 5 months ago |
0.5.0-beta.57 | 59 | 5 months ago |
0.5.0-beta.56 | 66 | 5 months ago |
0.5.0-beta.54 | 57 | 5 months ago |
0.5.0-beta.39 | 88 | 5 months ago |
0.5.0-beta.38 | 81 | 5 months ago |