I have a razor view with model object that is a collection of items that have two language properties, one for English and one for French. I am looking for a way to dynamically reference the correct language property in a razor view.
I can do this:
if (Culture == "en-CA")
return model.English;
else
return model.French;
But I want to do something like this:
if (Culture == "en-CA")
lang = "English"
else
lang = "French"
...
@foreach (var record in Model) {
@record.lang
}
Any ideas?