I have a problem when trying to print a linq query, after making the following query
var cargaDatos = (from rs in DB.C_gestcobcanalvendsem
group rs by new { rs.semana } into s
orderby s.Key
select new
{
Semana = s.Key,
TotalDeuda = s.Sum(x => x.Credito)
}
).ToList();
return View(cargaDatos);
I try to print with the recommended way
<% foreach (var item in Model) { %>
<tr>
<td>
<%: Html.DisplayFor(modelItem => item.Semana) %>
</td>
<% } %>
or similar forms, but i don't find the form to print it. (possibly i'm doing something wrong but can not find the right way to manipulate the linq query whit 'group by clause').
regards