标签:
不能传入out或ref public IEnumerable<Shop> GetShop() { for (int i = 1; i < 11; i++) { yield return new Shop { ID = i, Name = "Shop-" + i }; } }
yield让代码更加简洁
原文地址:http://www.cnblogs.com/zjflove/p/4600338.html