PabloCache.Abstractions 1.0.0-alpha

This is a prerelease version of PabloCache.Abstractions.
dotnet add package PabloCache.Abstractions --version 1.0.0-alpha                
NuGet\Install-Package PabloCache.Abstractions -Version 1.0.0-alpha                
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="PabloCache.Abstractions" Version="1.0.0-alpha" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PabloCache.Abstractions --version 1.0.0-alpha                
#r "nuget: PabloCache.Abstractions, 1.0.0-alpha"                
#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 PabloCache.Abstractions as a Cake Addin
#addin nuget:?package=PabloCache.Abstractions&version=1.0.0-alpha&prerelease

// Install PabloCache.Abstractions as a Cake Tool
#tool nuget:?package=PabloCache.Abstractions&version=1.0.0-alpha&prerelease                

PabloCache Component

The PabloCache component provides an abstraction layer for a versatile caching mechanism in a .NET application. It is designed to be easily integrated into your project using the Microsoft.Extensions.DependencyInjection framework.

ICacheService Interface

The ICacheService interface, found in the PabloCache.Abstractions.Api.Services namespace, defines methods for interacting with the cache. It includes the following methods:

  • GetCachedValue<T>: Retrieves a cached value by providing a cache key, a resolver function to generate the value if not found, and an optional time-to-live (TTL) in minutes.

      Task<T> GetCachedValue<T>(string cacheKey, Func<Task<T>> resolver, int ttlMinutes = 5) where T : class;
    
  • TryGetCachedValue<T>: Attempts to retrieve a cached value by providing a cache key, a resolver function to generate the value if not found, and an optional time-to-live (TTL) in minutes. Unlike GetCachedValue, this method returns a nullable result.

      Task<T?> TryGetCachedValue<T>(string cacheKey, Func<Task<T?>> resolver, int ttlMinutes = 5) where T : class;
    

IPabloCacheComponent Interface

The IPabloCacheComponent interface, found in the PabloCache.Abstractions.Configuration namespace, defines a method for configuring the caching component within the Dependency Injection framework.

  • SetCacheService<T>: Sets the cache service implementation type, allowing customization of the caching behavior. The ServiceLifetime parameter specifies the lifetime of the service in the DI container.
      IPabloCacheComponent SetCacheService<T>(ServiceLifetime lifetime = ServiceLifetime.Scoped) where T : ICacheService;
    

ServiceCollectionExtensions

The ServiceCollectionExtensions class, found in the PabloCache.Abstractions.Configuration namespace, provides an extension method for IServiceCollection to simplify the registration of the PabloCache component.

  • AddPabloCaching: Adds the PabloCache component to the service collection. It accepts an optional configuration delegate for customizing the component before registration.
      public static IServiceCollection AddPabloCaching(this IServiceCollection services, Action<IPabloCacheComponent>? componentConfig = null);
    

Usage Example:

services.AddPabloCaching(component => 
{
    // Set your own implementation of the cache service
    component.SetCacheService<CustomCacheService>(ServiceLifetime.Singleton);
});
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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 PabloCache.Abstractions:

Package Downloads
PabloDispatch

PabloDispatch is a C# library designed to simplify and implement the Command Query Responsibility Segregation (CQRS) pattern in your application.

PabloCache.Redis

The PabloCache Memory Cache Implementation extends the PabloCache component by providing a concrete implementation using Microsoft's Memory Cache. This implementation allows you to use an in-memory cache for your caching needs.

PabloCache.MemoryCache

The PabloCache Memory Cache Implementation extends the PabloCache component by providing a concrete implementation using Microsoft's Memory Cache. This implementation allows you to use an in-memory cache for your caching needs.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0-alpha 150 12/28/2023
0.1.0-alpha 123 12/24/2023