Q:

Generic type in constructor parameter

I want to use a generic type in a constructor parameter like this:
public class Myclass
{
    public Myclass<T>(IEnumerable<T> ListeValeurChampPerso, string str, int a)
     {
       foreach (var vr in ListeValeurChampPerso)
       {...
       }
    }
}

but it generates me a lot of errors. How can i do this?
Thanks in advance.

A:

You have to make the class generic, you can't have a generic constructor because it would be meaningless because you couldn't use T outside of the constructor.
This will work fine.
public class Myclass<T>
{
    public Myclass(IEnumerable<T> ListeValeurChampPerso, string str, int a)
     {
       foreach (var vr in ListeValeurChampPerso)
       {...
       }
    }
}

