Models Builder get property value in another culture than the current one #12696
RosenPetrov
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
-
Hey,
Let's have an example.
Let's say we have a models builder model named Country and a string property named Capital. The country and the Capital vary by culture.
When a page on the site is loaded in EN language and I have the Country used on that page the Capital prop comes in EN language. But I need to get the DE version for example and I can't figure out how because the Capital property doesn't accept culture. Is there a way to accomplish that? Kind of the switch the culture temporarily or so until we get the proper value in DE and then switch it back? This is also handy when I run code in Hangfire background task where the culture is totally off. How I do it now is to call the Value with culture specified but this way I lose the strongly type and I don't like it.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions