嗨,我想在我的blazor中显示一个简单的表格,并根据日期、对数据进行排序
<tbody>
@foreach (var received in Rec)
{
<tr>
<td>@received.DocumentType</td>
<td>@received.SenderName</td>
<td>@received.Subject</td>
<td>@received.Date</td>
<td>@received.Forwarded</td>
<td>@received.Remarks</td>
</tr>
}
</tbody>
使用Linq。。。
@using System.Linq
@foreach (var received in Rec.OrderBy(a => a.Date))
{
...
}