How to create List of open generic type of class<T>?
问题 i am working on someone else code i need to add few things i have a class public abstract class Data<T> { } public class StringData : Data<string> { } public class DecimalData : Data<decimal> { } in my program i want to maintain list of different type of data List<Data> dataCollection=new List<Data>(); dataCollection.Add(new DecimalData()); dataCollection.Add(new stringData()); List<Data> dataCollection=new List<Data>(); at above line i am getting compiler error Using the generic type 'Data'