AuroraScienceHub.Framework.Caching 10.0.5

Prefix Reserved
dotnet add package AuroraScienceHub.Framework.Caching --version 10.0.5
                    
NuGet\Install-Package AuroraScienceHub.Framework.Caching -Version 10.0.5
                    
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="AuroraScienceHub.Framework.Caching" Version="10.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AuroraScienceHub.Framework.Caching" Version="10.0.5" />
                    
Directory.Packages.props
<PackageReference Include="AuroraScienceHub.Framework.Caching" />
                    
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 AuroraScienceHub.Framework.Caching --version 10.0.5
                    
#r "nuget: AuroraScienceHub.Framework.Caching, 10.0.5"
                    
#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 AuroraScienceHub.Framework.Caching@10.0.5
                    
#: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=AuroraScienceHub.Framework.Caching&version=10.0.5
                    
Install as a Cake Addin
#tool nuget:?package=AuroraScienceHub.Framework.Caching&version=10.0.5
                    
Install as a Cake Tool

AuroraScienceHub.Framework.Caching

Extension methods for .NET's HybridCache to simplify caching operations in distributed applications.

Overview

Provides extension methods for Microsoft's HybridCache to simplify common caching operations with automatic JSON serialization.

Key Features

  • Simplified API - Easy-to-use extension methods for HybridCache
  • Type-Safe Operations - Generic methods with strong typing
  • JSON Serialization - Automatic serialization/deserialization
  • Async/Await - Fully asynchronous operations

Installation

dotnet add package AuroraScienceHub.Framework.Caching

Usage

Service Registration

builder.Services.AddHybridCache(options =>
{
    options.MaximumPayloadBytes = 1024 * 1024; // 1 MB
    options.DefaultEntryOptions = new HybridCacheEntryOptions
    {
        Expiration = TimeSpan.FromMinutes(5)
    };
});

Basic Operations

// String operations
var value = await cache.GetStringAsync("my-key");
await cache.SetStringAsync("my-key", "my-value", TimeSpan.FromMinutes(5));

// Byte operations
var bytes = await cache.GetBytesAsync("image-key");
await cache.SetBytesAsync("image-key", imageData, TimeSpan.FromHours(1));

// JSON object caching
var user = await cache.GetOrCreateJsonAsync(
    $"user:{userId}",
    async ct => await _userService.GetUserAsync(userId, ct),
    options: new HybridCacheEntryOptions { Expiration = TimeSpan.FromMinutes(10) });

Service Example

public class ProductService
{
    private readonly HybridCache _cache;
    private readonly IProductRepository _repository;

    public async Task<Product> GetProductAsync(int id, CancellationToken ct = default)
    {
        return await _cache.GetOrCreateJsonAsync(
            $"product:{id}",
            async token => await _repository.GetByIdAsync(id, token),
            options: new HybridCacheEntryOptions { Expiration = TimeSpan.FromMinutes(15) },
            cancellationToken: ct);
    }
}

License

See LICENSE file in the repository root.

  • AuroraScienceHub.Framework.Json - JSON serialization with optimized settings
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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

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
10.0.5 104 4/23/2026
10.0.4 117 4/23/2026
10.0.3 128 2/11/2026
10.0.2 121 1/29/2026
10.0.1 244 12/25/2025
10.0.0 434 12/11/2025
9.0.7 442 11/20/2025
9.0.6 192 11/15/2025
9.0.5 149 11/8/2025
9.0.4 154 10/24/2025
9.0.3 223 10/15/2025
9.0.2 194 10/15/2025
9.0.1 211 10/14/2025
9.0.1-workflow-test-2.17 154 10/14/2025