Closed ivantran85 closed 5 years ago
Hello @ivantran85 ,
Adding AsQueryable
doesn't work as that's not a context query.
However, it's possible for you to still cache this kind of query using your own cache key.
For example:
var employerInfo = _context.usp_get_cpr_employer_info(data.Identifier, data.PolicyId).Cache("myCacheKey").SingleOrDefault();
Let me know if that solution work for you.
Best Regards,
Jonathan
Hello @ivantran85 ,
This issue will be closed since it has been answered.
Feel free to reopen it if you feel otherwise.
Best Regards,
Jonathan
Hi Team, I am trying to use Cache for a result from a store procedure like this
And I got an error below
System.Exception: Oops! The ObjectQuery cannot be found. Please use an explice key or report this issue here: https://github.com/zzzprojects/EntityFramework-Classic/issues at Z.EntityFramework.Classic.QueryCacheManager.GetCacheKey(IQueryable query)
Could you please help to fix it
Thanks so much