This is similar to C # - several common types in one list
However, I want the generic method to accept a list of objects that implement the same interface.
This code gives an error that there is no implicit link translation.
public interface ITest { } public class InterfaceUser : ITest { } public class TestClass { void genericMethod<T>(T myList) where T : List<ITest> { } void testGeneric() { genericMethod(new List<InterfaceUser>()); } }
Can this be done?
source share