I am trying to send to an IEnumerable view and show every element in it, but I have a problem sending. It states that:
{System.Linq.Enumerable.WhereSelectEnumerableIterator<System.Linq.IGrouping<string,MvcApplication4.Models.USER>,<>f__AnonymousType8<string,int>>}
and I donβt know how to handle this.
This is my opinion:
@model IEnumerable<dynamic>
I get dynamic because I get to this view from a couple of functions on how to send different types.
<table border="1" style="text-align:center"> <tr> <td> </td> <td> user name </td> <td>age </td> <td>comments </td> </tr> @foreach (var t in (Model)) { <tr> <td>@(count++))</td> <td> @Console.WriteLine(t)</td> <td> </td> <td> </td> </tr> } </table>
I get IEnumerable from this linq:
var allU = (from m in comList join c in users on m.user equals c.user into cm1 from cm2 in cm1.DefaultIfEmpty() group cm2 by m.user into grouped select new { name = grouped.Key, count = grouped.Count() }).AsEnumerable();
So my question really is: how can I get its elements in a view?
SH.IN source share