The accepted answer will not work for duplicates in the collection. If you're set on the foreach
, you can just add your own indexing variable(s).
int last = Model.Results.Count - 1;
int index = 0;
foreach (Item result in Model.Results)
{
//Do Things
if (index == last)
//Do Things with the last result
index++;
}