Safe convert function
<p>Can someone explain me this code, especially I'm not sure how generic function as parameter works:</p>

<pre><code>result.Notes= orderInfo.Notes.SafeConvert(x =&gt; (Communication.OrderNotes)x);            

public static TOut[] SafeConvert&lt;TIn, TOut&gt;(
        this TIn[] input,
        Func&lt;TIn, TOut&gt; converter)
    {
        if (input == null)
        {
            return null;
        }

        return input
            .Where(i =&gt; i != null)
            .Select(converter)
            .ToArray();
    }
</code></pre>