我在 C# 中有这个 Razor 代码,并尝试在 Knockout 中做同样的事情
@foreach (var group in Model.Details.SonstigeNummern.OeReferenznummern.GroupBy(x => x.Hersteller))
{
<tr class="ListItem @oddeven">
<td>@group.Key</td>
<td>
@foreach (var nummer in group)
{
@nummer.Nummer<br />
}
</td>
</tr>
}
我不知道如何管理 GroupBy。
我的 Viewmodel 与我的 c# 模型具有相同的语法
有人可以帮忙吗?
真诚的