In some cases you have to write out in cshtml files. The syntax for this you can find in the code snippet.
@foreach (var a in new List<string> {"a", "b", "c"}) { @a @: }