I have an MVC 3 application with all texts in a SQL database. The texts has names and values for each language. I want to store the texts in cache object and somehow get them in my views and in my controllers based on some session variables.
My first solution has been to store an object TextHandler in the Cache. TextHandler has all texts and methods to help extracting texts by their name (as a string) and by some other values. I also have some controller methods and helpers to get texts from TextHandler based on session variables. I’m not satisfied by this solution.
I’ve found some guides for this, but what I really need are some pointers on how to do it and not actual code.
I ended up with a custom resource provider like http://weblogs.asp.net/thangchung/archive/2010/06/25/extending-resource-provider-for-soring-resources-in-the-database.aspx with minor modifications.