Closed santubangalore closed 5 years ago
Unable to resolve service for type 'CacheManager.Core.ICacheManager`1[System.Object]'
means you have not registered the ICacheManager
service and the in use IoC Container doesn't know how/where to find it. follow this sample for more info. You should use addInMemoryCacheServiceProvider
or addRedisCacheServiceProvider
after calling AddEFSecondLevelCache
.
Also you should use IQueryable<TType> query
. Take a look at this file to see how different overloads of Cacheable
are defined.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related problems.
Summary of the issue
Environment
Example code/Steps to reproduce:
**I have created extension method ToCacheList in a class.
next i am invoking the method with iqueryable object.
var q = from c in this.Query() select c;
return await q.ToCacheList();**
public static async Task<IEnumerable> ToCacheList(this IQueryable query)
{
EFCacheDebugInfo debugInfo = new EFCacheDebugInfo();
var result = redisOn ?
await query.Cacheable(debugInfo).ToListAsync() :
await query.ToListAsync();
return result;
}
Output: