c# Generic List
Posted
by user177883
on Stack Overflow
See other posts from Stack Overflow
or by user177883
Published on 2010-03-21T23:02:15Z
Indexed on
2010/03/21
23:11 UTC
Read the original article
Hit count: 366
I m populating data for different entities into set of lists using generic lists as follows :
List<Foo> foos ..
List<Bar> bars ..
I need to write these lists to a file, i do have a util method to get the values of properties etc. using reflection.
What i want to do is: using a single method to write these into files such as:
void writeToFile(a generic list)
{
//Which i will write to file here.
}
How can i do this?
I want to be able to call :
writeToFile(bars);
writeToFile(foos);
© Stack Overflow or respective owner