ForEach Methods Implementation for Multidimensional Array in C#
The solution is fine as it easy as it could be but there's a better way to make the access to it - extension method.
public static class ArrayHelpers
{
    public static void ForEach&lt;T&gt;(this Array array, in Action&lt;T&gt; action)
    {
        if (ReferenceEquals(array, null))
        {
            throw new ArgumentNullException(nameof(array));
        }

        if (ReferenceEquals(action, null))
        {
            throw new ArgumentNullException(nameof(action));
        }

        foreach (T item in array)
        {
            action.Invoke(item);
        }
        return;
    }
}

Then the test cases can look like this
Console.WriteLine(&quot;One dimensional case&quot;);
int[] test = new int[] { 1, 2, 3, 4 };
test.ForEach&lt;int&gt;(ShowSquares);

Console.WriteLine(&quot;Two dimensional case&quot;);
int[,] test2 = { { 0, 1 }, { 2, 3 } };
test2.ForEach&lt;int&gt;(ShowSquares);

Console.WriteLine(&quot;Three dimensional case&quot;);
int[,,] test3 = { { { 0, 1 }, { 2, 3 } }, { { 0, 1 }, { 2, 3 } } };
test3.ForEach&lt;int&gt;(ShowSquares);