How to put an interface in a generic dynamically?
<p>I have the following test class:</p>

<pre><code>public class OutsideClass
{
    private List&lt;Type&gt; _interfaces = null;

    public void InjectInterfaces(Type[] types)
    {
        if(_interfaces == null)
        {
            _interfaces = new List&lt;Type&gt;();
        }

        foreach (var type in types)
        {
            if(type.IsInterface)
            {
                _interfaces.Add(type);
            }
        }
    }

    public void PerformSomethingWithTheInterfaces()
    {
        foreach (var i in _interfaces)
        {
            new Test&lt;i&gt;().PerformSomething(); // On this line the error occurs
        }
    }
}

internal class Test&lt;T&gt;
{
    internal void PerformSomething()
    {

    }
}
</code></pre>

<p>This gives me on  however the message <code>Type or namespace name expected</code>. How can I adjust this code so that it works?</p>

<p>What I am trying to do is to pass in a bunch of interfaces to a class library, there loop over the interfaces and use <strong>Unity</strong> to Resolve, based on the interface, something. I use the Resolve extension method.</p>
