Base solution for your next web application
Open Closed

Trying to use GetCache #1164


User avatar
0
joemo created

I can use the cache successfully like this:-

var members = _cacheManager .GetCache("MembersCache") .Get("Members", () => GetMembersFromDatabase(input.ParentCompanyId)) as List<Customer>;

which calls this:- private List<Customer> GetMembersFromDatabase(int ParentCompanyId) { return _customerRepository.GetAllList(x => x.ParentCompanyId == ParentCompanyId); }

I've set the timeout to 15 mins. The problem is, after 15 minutes it returns no results. I would have expected it to start calling the GetMembersFromDatabase function again to get fresh data, but it doesn't Where am I going wrong?


No answer yet!