Baubit.Caching.Extensions 2026.1.1

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Baubit.Caching.Extensions --version 2026.1.1
                    
NuGet\Install-Package Baubit.Caching.Extensions -Version 2026.1.1
                    
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="Baubit.Caching.Extensions" Version="2026.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Baubit.Caching.Extensions" Version="2026.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Baubit.Caching.Extensions" />
                    
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 Baubit.Caching.Extensions --version 2026.1.1
                    
#r "nuget: Baubit.Caching.Extensions, 2026.1.1"
                    
#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 Baubit.Caching.Extensions@2026.1.1
                    
#: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=Baubit.Caching.Extensions&version=2026.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Baubit.Caching.Extensions&version=2026.1.1
                    
Install as a Cake Tool

Baubit.Caching.Extensions

CircleCI codecov<br/> NuGet NuGet <br/> .NET Standard 2.0 License: MIT<br/> Known Vulnerabilities

Backward-compatible type specializations for Baubit.Caching with concrete ID types (long and Guid).

Why This Package Exists

Baubit.Caching v2025.52+ introduced generic ID types (TId) for maximum flexibility. While this makes the core library more powerful, it adds complexity for simple use cases.

This package bridges the gap by providing concrete type specializations that:

  • Maintain backward compatibility for projects using primitive IDs (long, Guid)
  • Reduce boilerplate - no generic type parameters on every declaration
  • Keep Baubit.Caching's core surface area minimal while supporting common scenarios

Installation

dotnet add package Baubit.Caching.Extensions

Quick Comparison

Generic API (Baubit.Caching)

// Generic - flexible but verbose
OrderedCache<Guid, MyData> cache = new OrderedCache<Guid, MyData>(...);
IOrderedCache<Guid, MyData> myCache = cache;

Specialized API (Baubit.Caching.Extensions)

// Specialized - simpler for common cases
using Baubit.Caching.Extensions.Guid7;

OrderedCache<MyData> cache = new OrderedCache<MyData>(...);
IOrderedCache<MyData> myCache = cache;

What's Included

1. Guid7 Namespace - GuidV7-based IDs

Use when: You need time-ordered, globally unique identifiers.

using Baubit.Caching.Extensions.Guid7;
using Baubit.Caching.Extensions.Guid7.InMemory;
using Baubit.Identity;

var config = new Configuration { MaxL1Capacity = 100 };
var generator = GuidV7Generator.CreateNew();
var l1Store = new Store<string>(generator, loggerFactory);
var l2Store = new Store<string>(generator, loggerFactory);
var metadata = new Metadata(config, loggerFactory);

var cache = new OrderedCache<string>(config, l1Store, l2Store, metadata, loggerFactory);

Types provided:

  • OrderedCache<TValue>OrderedCache<Guid, TValue>
  • IOrderedCache<TValue>IOrderedCache<Guid, TValue>
  • IStore<TValue>IStore<Guid, TValue>
  • IMetadataIMetadata<Guid>
  • CacheEnumeratorCollectionCacheEnumeratorCollection<Guid>
  • ICacheAsyncEnumeratorFactory<TValue>ICacheAsyncEnumeratorFactory<Guid, TValue>
  • ICacheEnumeratorICacheEnumerator<Guid>
  • InMemory.Store<TValue>InMemory.Store<Guid, TValue>
  • InMemory.MetadataInMemory.Metadata<Guid>
  • InMemory.Entry<TValue>InMemory.Entry<Guid, TValue>

2. Long Namespace - Sequential Integer IDs

Use when: You need simple, sequential numeric identifiers.

using Baubit.Caching.Extensions.Long;
using Baubit.Caching.Extensions.Long.InMemory;

var config = new Configuration { MaxL1Capacity = 100 };
var l1Store = new Store<string>(loggerFactory);
var l2Store = new Store<string>(loggerFactory);
var metadata = new Metadata(config, loggerFactory);

var cache = new OrderedCache<string>(config, l1Store, l2Store, metadata, loggerFactory);

Types provided:

  • OrderedCache<TValue>OrderedCache<long, TValue>
  • IOrderedCache<TValue>IOrderedCache<long, TValue>
  • IStore<TValue>IStore<long, TValue>
  • IMetadataIMetadata<long>
  • CacheEnumeratorCollectionCacheEnumeratorCollection<long>
  • ICacheAsyncEnumeratorFactory<TValue>ICacheAsyncEnumeratorFactory<long, TValue>
  • ICacheEnumeratorICacheEnumerator<long>
  • InMemory.Store<TValue>InMemory.Store<long, TValue>
  • InMemory.MetadataInMemory.Metadata<long>
  • InMemory.Entry<TValue>InMemory.Entry<long, TValue>

Key Differences

ID Generation

Guid7 (GuidV7)
  • Auto-generated: Pass IIdentityGenerator to Store constructor
  • Time-ordered: IDs naturally sort chronologically
  • Globally unique: Safe for distributed systems
var generator = IdentityGenerator.CreateNew();
var store = new Store<string>(generator, loggerFactory);
Long (Sequential)
  • Auto-generated: Starts at 1, increments by 1
  • Sequential: IDs are monotonically increasing integers
  • Compact: Smaller memory footprint than GUIDs
var store = new Store<string>(loggerFactory);  // No generator needed

Migration Guide

From Generic Baubit.Caching

Before:

using Baubit.Caching;

OrderedCache<Guid, MyData> cache = new OrderedCache<Guid, MyData>(...);
IOrderedCache<Guid, MyData> iCache = cache;

After:

using Baubit.Caching.Extensions.Guid7;

OrderedCache<MyData> cache = new OrderedCache<MyData>(...);
IOrderedCache<MyData> iCache = cache;

Namespace Mapping

Generic Type Guid7 Specialization Long Specialization
OrderedCache<Guid, T> Guid7.OrderedCache<T> -
OrderedCache<long, T> - Long.OrderedCache<T>
IStore<Guid, T> Guid7.IStore<T> -
IStore<long, T> - Long.IStore<T>
IMetadata<Guid> Guid7.IMetadata -
IMetadata<long> - Long.IMetadata

When NOT to Use This Package

  • Custom ID types: If you need int, string, or custom structs as IDs → use Baubit.Caching directly
  • Maximum flexibility: If you want full control over generic type parameters → use Baubit.Caching directly
  • Mixed ID types: If you need multiple cache types with different IDs in same project → use Baubit.Caching directly

For the Full Story

This package is a thin compatibility layer. For complete documentation, see:

Baubit.Caching Documentation

Topics covered there:

  • Architecture and design rationale
  • Complete API reference with examples
  • Performance characteristics and benchmarks
  • Thread safety guarantees
  • Multi-consumer streaming patterns
  • Async enumeration
  • Eviction strategies
  • Configuration options

License

MIT License - see LICENSE file for details.

Contributing

Contributions welcome! Please:

  1. Read Baubit.Caching's architecture first
  2. Keep changes minimal - this is a compatibility layer
  3. Maintain 100% test coverage
  4. Follow existing code style

Version Compatibility

This package tracks Baubit.Caching versions:

  • Baubit.Caching.Extensions 2025.52.xBaubit.Caching 2025.52.x
  • Always use matching versions to avoid breaking changes
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.  net9.0 was computed.  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. 
.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

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
2026.1.2-prerelease 212 1/3/2026
2026.1.1 277 12/31/2025
2026.1.1-prerelease 84 12/31/2025
2025.52.4-prerelease 90 12/27/2025
2025.52.3-prerelease 86 12/27/2025
2025.52.2-prerelease 99 12/26/2025
2025.52.1-prerelease 143 12/26/2025