I run this query in SQL Server:
SELECT
COUNT(SERIAL) AS [Cantidad de computadoras entregadas],
FechaEntrega AS [Fecha de Entrega]
FROM
Inventary
WHERE
Modelo = 0 AND FechaEntrega > '2001-01-01 10:48:47.0000000'
GROUP BY
FechaEntrega
ORDER BY
FechaEntrega
I try to make that table with the C# methods but I don't get it, apparently, I am misusing the GroupBy()
method
<table>
<thead>
<tr>
<th>Fecha</th>
</tr>
</thead>
<tbody>
@foreach(
var item in Model.Inventary
.Where(m => m.Modelo == 0)
.Where(f => f.FechaEntrega.Year > 2005)
.GroupBy( e => e.FechaEntrega)
)
{
<tr>
<td>
@Html.DisplayNameFor(modelItem => item.FechaEntrega)
</td>
</tr>
}
</tbody>
</table>