@foreach(var inmate in Model)
{
@inmate.inmateid
@inmate.inmateid
}
My Model is an IEnumerable of inmates
containing 2 inmate objects. But the
result I am getting in my browser is
6
6
7
7
Instead of
6
7
Please can someone tell me why this is
the case?
Thanks
Because you enumerating collection, and for each item You are writing this item twice. If you want it just once remove one @inmate.inmateid from inside foreach loop.