メソッドからタプルを返す方法について、良い提案がありました。
C# のメソッドから複数の値を返すにはどうすればよいですか?
ここで、コードが 2 つの値だけでなく IEnumerable< > を生成することに気付きました。ここまでの私のコードは、result に IEnumerable が含まれているところです。メモとタイトルを含む匿名オブジェクトだと思います。データをタプルに入れる方法と、変数 myList からデータを取得する方法がよくわかりません。myList に対して foreach を実行できますか?
public static IEnumerable< Tuple<string, string> > GetType6()
{
var result =
from entry in feed.Descendants(a + "entry")
let notes = properties.Element(d + "Notes")
let title = properties.Element(d + "Title")
// Here I am not sure how to get the information into the Tuple
//
}
var myList = GetType6();