У меня есть коллекция типов IEnumerable. Я хочу, чтобы показать, как это:нарушение Ienumerable на две части
а) получить первый элемент из коллекции по дате и показать под заголовком 1 б) вскрывать оставшиеся коллекции и показать все остальные элементы под заголовком 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 внизу. Как сделать заголовок первым и первым элементом вверху. Пожалуйста, предложите