jgauffin / griffin.mvccontrib

A contribution project for ASP.NET MVC3
http://blog.gauffin.org/tag/griffin-mvccontrib/
GNU Lesser General Public License v3.0
83 stars 40 forks source link

Caching of the ViewLocalizer #38

Closed peter-bozovic closed 11 years ago

peter-bozovic commented 11 years ago

Hello,

It looks like it is not possible anymore to override the ViewLocalizer class and handle cache that way (as suggested on CodeProject) I tried to register my new class in every possible way within the Autofac builder but the GriffinWebViewPage is unable to find it and is constantly initializing the ViewLocalizer(IViewLocalizationRepository)

Is there any other suggestion on how to handle cache ? My pages are getting bigger and bigger and i'm getting hundreds of sql requests that I would like to avoid :)

Thanks

jgauffin commented 11 years ago

Did you try: containerBuilder.RegisterType<YourLocalizer>().As<ViewLocalizer>().SingleInstance()?

peter-bozovic commented 11 years ago

That worked ! Thank you very much :)