Skip to content

maldworth/CacheManager.FileCaching

Repository files navigation

CacheManager.FileCaching

Build Status

Branch Status
master master
develop develop

Nuget Package

Package Name FullFramework .NET Standard
NuGet 4.0/4.5 2.0

Overview

This library has implemented CacheManager.Core's BaseCacheHandle<T> using FileCache as our persistent store. Cache Manager 2.0.0-prerelease must be used in order to support NetStandard.

Quick Start

I assume you are already familiar with CacheManager, so really the only thing you need to get going is configure.

var config = new ConfigurationBuilder()
    .WithJsonSerializer() // Only need this line if targeting netstandard
    .WithFileCacheHandle()
    .Build();

var _cache = new BaseCacheManager<string>(config);

// Then somewhere else in your code
_cache.Add("mykey","myvalue");

var result = _cache.Get<string>("mykey");

Note: NetStandard target of CacheManager doesn't support BinarySerializer right now

Please look in the unit tests for other examples of caching Complex Objects.