VersaTul.Caching
1.0.19
Prefix Reserved
See the version list below for details.
dotnet add package VersaTul.Caching --version 1.0.19
NuGet\Install-Package VersaTul.Caching -Version 1.0.19
<PackageReference Include="VersaTul.Caching" Version="1.0.19" />
paket add VersaTul.Caching --version 1.0.19
#r "nuget: VersaTul.Caching, 1.0.19"
// Install VersaTul.Caching as a Cake Addin #addin nuget:?package=VersaTul.Caching&version=1.0.19 // Install VersaTul.Caching as a Cake Tool #tool nuget:?package=VersaTul.Caching&version=1.0.19
VersaTul Caching
VersaTul Caching is a project that provides a simplified caching interface with the ability to change the underlying caching engine easily and quickly.
Features
- Default cache engine based on Microsoft Extensions Caching Memory class
- Ability to replace the cache engine with another provider
- Cache configuration interface for accessing configuration settings
- Cache provider interface for adding, retrieving, removing and checking cache entries
Installation
To install VersaTul Caching, you need to have .NET Core 3.1 or higher installed on your machine. You can download it from here.
To add VersaTul Caching to your project, you can use the NuGet package manager or the dotnet CLI.
Using NuGet:
Install-Package VersaTul.Caching
Using dotnet CLI:
dotnet add package VersaTul.Caching
Usage/Examples
To use VersaTul Caching, you need to create an instance of the cache provider and pass it the cache configuration. For example:
using VersaTul.Caching;
// Create a cache configuration with default settings
ICacheConfiguration cacheConfig = new CacheConfiguration();
// Create a cache provider with the default cache engine
ICacheProvider<string> cacheProvider = new MemCacheProvider<string>(cacheConfig);
// Add a cache entry with a key and a value
cacheProvider.Add("key", "value");
// Get a cache entry by its key
string value = cacheProvider.Get("key");
// Check if a cache entry exists by its key
bool exists = cacheProvider.IsExists("key");
// Remove a cache entry by its key
cacheProvider.Remove("key");
You can also use a different cache engine by implementing the ICacheProvider interface and passing it to the cache provider constructor. For example:
using VersaTul.Caching;
// Create a custom cache engine that implements ICacheProvider
public class CustomCacheProvider<T> : ICacheProvider<T>
{
// Implement the methods of the ICacheProvider interface
// ...
}
// Create a cache configuration with custom settings
ICacheConfiguration cacheConfig = new CacheConfiguration();
cacheConfig.CacheDuration = 60; // Set the cache duration to 60 seconds
// Create a cache provider with the custom cache engine
ICacheProvider<string> cacheProvider = new CustomCacheProvider<string>(cacheConfig);
// Use the cache provider as usual
// ...
Documentation
For more information on VersaTul Caching, please refer to the official documentation.
License
VersaTul Caching is licensed under the MIT License.
Product | Versions 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. |
-
net8.0
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
- VersaTul.Configurations (>= 1.0.15)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.