using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace ConsoleApplication22
{
class Program
{
static void Main(string[] args)
{
foreach (Txt t in GetList())
{
Console.WriteLine(t.id+"==="+t.name);
}
}
static IEnumerable<Txt> GetList()
{
for (int i = 0; i < 10; i++)
{
yield return new Txt
{
id = i,
name = "txt" + i
};
}
}
}
class Txt
{
public string name{get;set;}
public int id{get;set;}
}
}