You cannot pass a specific type to a method because List is not covariant.
You can try something like this:
public void doStuffToLines<T>(IList<T> lines) where T : Line {
By specifying a general constraint, you can restrict the generic type passed to an object of type Line or its descendants.
It should be noted that if you are using .NET 4.0, you can change your method to List to IEnumerable, because the general parameter T is covariant.
source share