G
Guest
Hi all,
What is the syntax for a method that accepts a list of generic lists?
For example, I have a List that contains the following lists:
List<Car>
List<Boat>
List<Plane>
I want to pass this "list of lists" to a method so the list contents can be
persisted. For example, I am trying to do something like this (but I am lost
for the right syntax):
SaveObjectsToDisk(List<T> lists)
{
foreach(List list in lists)
{
foreach(Type T in list) db.Save(T);
}
}
Thanks!
What is the syntax for a method that accepts a list of generic lists?
For example, I have a List that contains the following lists:
List<Car>
List<Boat>
List<Plane>
I want to pass this "list of lists" to a method so the list contents can be
persisted. For example, I am trying to do something like this (but I am lost
for the right syntax):
SaveObjectsToDisk(List<T> lists)
{
foreach(List list in lists)
{
foreach(Type T in list) db.Save(T);
}
}
Thanks!