I would like the following code, writes the result from Linq into a csv file in a generic way, in order to not having to specify each one of the columns. Is it possible?
public void extractExamples()
{
using (var db = new LinqDB())
{
var query = from q in db.Cars
select q;
foreach (var element in query)
{
// Write to a csv file
}
}
}
As an additional point, I would also want to generate the csv in paralell, using:
query.AsParallel().ForAll(...
But, I imagine that I should control the opening and writing file. Therefore is there any tips how to do it?