I have a list of items I want to output as the contents of a main (the main in not included below). Each Item has 3 attributes: a Section Name, a Label and a Value. Each i
I really think that the use of @:
to work around such code is an abuse of that escape sequence. The problem should be addressed instead by correctly refactoring the code so that balanced tags can be easily written:
@foreach(var section in Model.GroupBy(i => i.SectionName)) {
@section.Key
}
12 lines of code instead of 18