c# Generic List
- by user177883
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);