0
我有一個IEnumerable類型的集合。我想表明它是這樣的:將Ienumerable分爲兩部分
一)按日期得到收集第一個元素和標題1 b在顯示)反向剩餘的收集和顯示標題2.
繼下的所有剩餘的元素是什麼,我創建
<ul style="list-style-type: none;">
@{
var responses = dispute.DisputeTransactions.GetTransactionByLogOnType(((CreditRegistryPrincipal)User).LogOnType);
var first = responses.OrderBy(dd => dd.TransactionDate).FirstOrDefault();
responses = responses.OrderByDescending(dd => dd.TransactionDate);
}
@if (dispute.Response > 0)
{
<h3 style="margin-left: -15px; margin-bottom: 10px;">
Responses and Feedbacks</h3>
}
@foreach (DisputeTransaction dt in responses)
{
if (dt.DisputeTransactionId == first.DisputeTransactionId)
{
// firstConversation = false;
<h3 style="margin-bottom: 10px">
Dispute</h3>
<ul class="firstConversation" style="margin-left: -15px">
<div class="dispute-notes">
@dt.Notes
</div>
</ul>
}
else
{
// responses = responses.SkipWhile(dd => dd.DisputeTransactionId == first.DisputeTransactionId);
<li class="dispute-item @(user.RegistryID == dt.ReportedById ? "mine" : "their")">
<div>
<span class="dispute-writter"><b>@dt.ReportedBy.FullName</b> on @CreditRegistryRepository.FormatDateTime(dt.TransactionDate)
wrote:<br />
</span>
<div class="dispute-content">
<div class="dispute-notes">
@dt.Notes
</div>
</div>
</div>
</li>
}
}
</ul>
但它顯示在底部的標題1。如何使標題一和第一個元素在頂部。請建議