Closed pgardella closed 7 years ago
Yeah this seems to have nothing todo with CacheManager.
Anyways, did you also change the ToDoController to extend from Controller
(MVC) instead of ApiController
(API)?
Thanks. Found the problem, which should have been obvious. If you are using the MVC Unity container, you need to put the caches somewhere in the MVC code.
I had it in a separate helper class, outside the Controller.
Good afternoon!
This may be a problem with my knowledge of DI at this point. If so, my apologies!
This is with Cache Manager 1.1.1
I'm following your example of the Single Page ToDo except with Unity MVC insead of Unity WebAPI.
In Global.asax.cs during app initialization (Application_Start), I create the IUnityContainer and register the Cache Manager instance:
Then in the helper class (which is where I use the cache), I add a property with the Dependency attribute on:
In my method, I get a Null Reference Exception anytime I try to use AllTermCache, whehter I'm PUTing or checking if it exists:
or
What did I miss in the example code on GitHub?