I am looking to create a List, where the type of T is several unrelated classes (with the same constructor arguments) that I know through reflection.
DataBase = new ArrayList();
foreach (Type T in Types)
{
DataBase.Add(new List<T>);
}
Unfortunately, Visual Studio says that 'The type or namespace T could not be found'. Is there some way I can implement this, or cast a List to type T? Thanks, Peter
dynamickeyword, perhaps? Assuming the right version of .NET...ArrayList, worst case just useList<object>if you must