Get the child controls with type T of a control
<p>I have the following function to get all the child controls of type.</p>

<pre><code>    private IEnumerable&lt;Control&gt; GetControlsOfType(Control control, Type type)
    {
        var controls = control.Controls.Cast&lt;Control&gt;();

        return controls.SelectMany(ctrl =&gt; GetControlsOfType(ctrl, type))
                                  .Concat(controls)
                                  .Where(c =&gt; c.GetType() == type);
    }
</code></pre>

<p>I am trying to convert it using generic type parameter.</p>

<pre><code>    private IEnumerable&lt;T&gt; GetControlsOfType&lt;T&gt;(Control control) where T: Control
    {
        var controls = control.Controls.Cast&lt;Control&gt;();

        return controls.SelectMany(ctrl =&gt; GetControlsOfType&lt;T&gt;(ctrl))
                                  .Concat(controls)
                                  .Where(c =&gt; c.GetType() == T);
    }
</code></pre>

<p>The code has the error on <code>.Concat</code>.</p>

<blockquote>
  <p>Error 6   'System.Collections.Generic.IEnumerable<code>&lt;T</code>>' does not contain a
  definition for 'Concat' and the best extension method overload
  'System.Linq.Queryable.Concat<code>&lt;TSource</code>>(System.Linq.IQueryable<code>&lt;TSource</code>>,
  System.Collections.Generic.IEnumerable<code>&lt;TSource</code>>)' has some invalid
  arguments</p>
</blockquote>

<p>How to fix the issue?</p>
