Open SharadaNagaraj opened 8 years ago
Without seeing the code that creates the session, I don't know how much help I can be. You are clearly not using the same UnitOfWork pattern from this tutorial.
What I can tell you is that the dynamic node providers are instantiated at application startup and remain in memory until the application recycles. But since you are creating the IWebCategoriesService
on the fly, this probably isn't a problem for your configuration. But then, you haven't posted the implementation of IWebCategoriesService
, either, so I would say you are probably not looking in the right place.
I'm working on a MVC ecommerce website with Autofac handling my DI and EF with unit of work for the database calls. I'm using MvcSitemapProvider 4.4.5 and configured it to use external DI. I have the dynamic nodes loaded from the database and have set cache expiry to 10 mins. When the site loads first time, the nodes are populated fine but when cache tries to refresh the nodes every 10 mins, the repository seems to lose the unit of work instance. I'm unable to correctly configure DI and repository pattern outside the controller. Can you please help me with this?
My Dynamic provider
My Service and repository
My mvc.sitemap
my Global.asax
My MvcSiteMapProviderConfig
my web.config