Open guilhermeluizsp opened 4 years ago
The solution here is to mark ILightCache as obsolete, create an implementation for it that's a wrapper over IDistributedCache, and add a temporary property to Workbench to make sure users that aren't still using injection can access it.
As metioned on https://github.com/Avanade/Liquid-Application-Framework/issues/108 , the MockCashe, AzureRedis and MemoryCache should implement ILightCache, but as we should prefer to use IDistributedCache, I'm wondering on how these classes are going to handle the methods return's differences as now ILightCache uses
Hi @ArtulanezAvanade,
LightCache
could be removed without further impacts on the framework. The issue just mentions that AzureRedis
, MemoryCache
, MockCache
(not familiar with the last one) should be updated to inherited directly IRedisCache
. All of this is related to that issue, not this one.This issue is stating that we should mark LightCache
as obsolete
since .NET already provides us with the excellent, battle-tested IDistributedCache
. In this case, MemoryCache and AzureRedis should also be obsoleted in favor of AddMemoryCache and RedisCache, both Microsoft implementations of IDistributedCache
.
UPDATE:
About MockCache
, I don't really know what is the responsibility of this class and must study it... Without looking into it, I just would say that we could change its inheritance to implement IDistributedCache
without much effort.
It looks like the
ILightCache
interface is an abstraction on top over the already abstracted IDistributedCache. Not only it has the same contract but also has the exact same purpose.https://github.com/Avanade/Liquid-Application-Framework/blob/1d6c37c44fb5bbb6f84ba2f1d1a8a1b3d646c2ad/src/Liquid.Base/Interfaces/Cache/ILightCache.cs#L6-L22