'group items accourding to invoice ID

I need to prepare invoice lists and in the each invoice there are more items added by user while shopping here my model

public partial class tblNormalSatisBekleyen
{
    public int Id { get; set; }
    public string urunAdi { get; set; }
    public string QB { get; set; }
    public int miktar { get; set; }
    public string  cari { get; set; }
    public int  plasiyerId { get; set; }
    public string paraBirimi { get; set; }
    public int  KDV { get; set; }
    public string satisTuru { get; set; }
    public string siparisId { get; set; }

    public virtual tblCariGenel tblCariGenel { get; set; }
}

my controller is like that

HomeController.cs

var orderList = db.tblNormalSatisBekleyen.OrderByDescending(x => x.tarih);
return View(orderList);

and my view page is like that

<table id="example" class="table table-bordered table-striped">
<thead>
    <tr>
        <th>Id</th>
        <th>Cari</th>
        <th>Sipariş Turu</th>
        <th>Detay</th>
    </tr>
</thead>
<tbody>
    @foreach (var item in Model)
    {
        <tr>
            <td>@item.Id</td>
            <td>@item.cari</td>
            <td>@item.satisTuru</td>
            <td><a href="/Home/Details">Details</a></td>
        </tr>
    }
</tbody>

but when I run this all items are displayed I just want to show just invoice title and group by "SiparisId" than after click the button show all the ordered items in the tables



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source