Closed szavoda closed 7 years ago
I was able to figure this out after digging into the code a bit more. Adding these lines for container registration took care of the issue:
_container.RegisterSingleton(app.ApplicationServices.GetService<IEFCacheKeyHashProvider>()); _container.RegisterSingleton(app.ApplicationServices.GetService<IEFCacheKeyProvider>()); _container.RegisterSingleton(app.ApplicationServices.GetService<IEFCacheServiceProvider>());
Probably you should move the services.UseSimpleInjectorAspNetRequestScoping
method to the end of the ConfigureServices
method to populate the registered services of the AddEFSecondLevelCache
method (add it after the AddEFSecondLevelCache
method).
That sounded like a plausible solution, but unfortunately, it did not work that way.
AddEFSecondLevelCache registers some initial services. Your DI should be able to retrieve them from the IServiceCollection.
I will do some research on SimpleInjector and see what I can come up with and post back here if / when I find something...
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.
Hi -
I am trying to implement EFSecondLevelCache into my project which also uses SimpleInjector. My issue is when the DI container is verified, it cannot resolve the "IEFCacheServiceProvider cacheServiceProvider". I assume there is something simple I am missing, but if anyone has any insights, I appreciate it. My Startup looks like this: