Closed IrvinDominin closed 7 years ago
Hi @alastairtree ,
In my webapi I'm calling LazyCache in order to cache some consumed webservices.
At the moment I see a cache, but the webmethods are not called.
Here is my code:
private Func<int, OBJDON> SWEB_CryptoClientCall = (x) => { OBJDON resultDom = new OBJDON(); using (PyAuth SERVIZIO = new PyAuth()) { resultDom = SERVIZIO.PY_GET_DATA("", 0, 1, x, 0); } return resultDom; };
The call:
OBJDON resultDom = new OBJDON(); resultDom = cache.GetOrAdd($"SWEB_{cryptoString}", () => SWEB_CryptoClientCall((int)CUR_UTE), DateTimeOffset.Now.AddDays(1));
resultDom is always null and the function is not fired. What am I doing wrong?
A colleague used the same key for another entity eletewhere, solved, now works flawlessly
Was going to say that code looks fine to me. Thanks for closing.
Hi @alastairtree ,
In my webapi I'm calling LazyCache in order to cache some consumed webservices.
At the moment I see a cache, but the webmethods are not called.
Here is my code:
The call:
resultDom is always null and the function is not fired. What am I doing wrong?