レストラン データがあり、特定のレストラン X を訪れたユーザーを分析しようとしています。データの構造は次のとおりです。
public class RestaurantXPatrons
{
public String PatronName { get; set;}
public List <strings> DateofVisits = new List <strings>();
}
lstX という RestaurantXPatrons のリストを作成しました。lstX をタブ区切りのテキスト ファイルに出力したいと考えています (後で Excel で表示するため)。だからここに私の出力コードがあります:
var output = lstX.Select ( x => x.PatronName + "\t" + x.DateofVisits );
string filepath = @"C:\data.txt";
System.IO.File.WriteAllLines(filepath, output);
Excel またはメモ帳で結果を表示すると、「System.Collections.Generic.List`1[System.String]」が表示されます。ここに、レストラン X の各利用者の DateofVisits リストの内容があるはずです。私の質問は、どのようにリストの内容を出力に取得しますか?