KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Why does this not compile? public interface IConcrete { } public class Concrete : IConcrete { } public class Runner { public static void Main() { var myList = new List<Concrete>(); DoStuffWithInterfaceList(myList); // compiler doesn't allow this } public static void DoStuffWithInterfaceList(List<IConcrete> listOfInterfaces) { } } And what's the quickest way to get myList to the correct type? EDIT I messed up the DoStuffWithInterfaceList example
Tags (comma-separated)
Save Edits
Cancel