This is what i come out with in the end
public static void forEach(this IEnumerable collection, dynamic action)
{
int i = 0;
foreach (var item in collection)
{
action(item, i, collection);
i++;
}
}