Autogenerate wrappers for caching, by using parameters and full namespaces.
It turns:
[Cache(3,TimeFrame.Minute,5,TimeFrame.Minute)]privateasyncTask<string>getAsyncValue(stringInput1,stringwibble="blarg"){return"Wibble Wobble";}to:
[Cache(3,TimeFrame.Minute,5,TimeFrame.Minute)]privateasyncTask<string>getAsyncValue(stringInput1,stringwibble="blarg"){return"Wibble Wobble";}publicasyncSystem.Threading.Tasks.Task<string>GetAsyncValue(stringInput1,stringwibble="blarg"){returnawaitMemoryCache.GetOrSetAsync<string>(JsonSerializer.Serialize(newTuple<string,string,string>("GoLive.Generator.Caching.CacheTower.Playground.Class1.getAsyncValue",Input1,wibble)),async arg =>awaitgetAsyncValue(Input1,wibble),newCacheSettings(TimeSpan.FromMinutes(3),TimeSpan.FromMinutes(5)));}Comes in two...no, three flavours:
- CacheTower
- Microsoft's IMemoryCache
- FusionCache