Easier way of accessing Dictionary values from services, components, non-pipelined MVC controllers #14425
jattwood
started this conversation in
Features and ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Arising out of this discussion, https://our.umbraco.com/forum/using-umbraco-and-getting-started/110717-umbracohelpergetdictionaryvalue-invariant-to-variationcontext-culture#comment-346213 it seems to me that a "sanctioned" means of accessing dictionary values from non-pipelined classes is needed. Injecting Umbraco Helper seems like a lot of overhead just to get a dictionary value. I am probably missing something here but the documentation says nothing about retrieving dictionary values other than Umbraco helper inside a pipelined controller. There are many cases when you need to get dictionary values from inside a view component, API controller, traditional MVC controller, service class, etc. I know there is ILocalizationService but in the nomenclature of Umbraco, the word service usually implies a database hit. I ended up writing a Translation Service class that you can see at the end of the thread. Thoughts on this appreciated.
Beta Was this translation helpful? Give feedback.
All reactions