VitreousCachingServiceCollectionExtensions class
Namespace: Vitreous.Caching
Assembly: Vitreous.Caching.dll
Extension methods to register Vitreous caching pipeline behaviors.
public static class VitreousCachingServiceCollectionExtensionsInheritance
Section titled “Inheritance”object ← VitreousCachingServiceCollectionExtensions
Inherited Members
Section titled “Inherited Members”object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Methods
Section titled “Methods”AddVitreousCaching(IServiceCollection, Action<VitreousCachingOptions>?)
Section titled “ AddVitreousCaching(IServiceCollection, Action<VitreousCachingOptions>?)”Registers the Vitreous caching pipeline behaviors backed by IDistributedCache.
public static IServiceCollection AddVitreousCaching(this IServiceCollection services, Action<VitreousCachingOptions>? configure = null)Parameters
Section titled “Parameters”services IServiceCollection
configure Action<VitreousCachingOptions>?
Returns
Section titled “Returns”Remarks
Section titled “Remarks”You must independently register an IDistributedCache implementation before calling this, for example:
// In-process memory cache (single instance):
services.AddDistributedMemoryCache();
// Redis (distributed, multi-instance):
services.AddStackExchangeRedisCache(o => o.Configuration = "localhost");
For full tag-based invalidation with Redis, use
AddVitreousRedisCaching() from the Vitreous.Caching.Redis package instead.