Simple Use IEnumerable<T>

Private static IEnumerable<T> FunDemo(T para)

{

  while(...)

    {

      ....

      yield return Obj;

    }

}

static main(arg[] arg)

{

  IEnumerable<T> list=FunDemo(para);

  foreach(var m in list)

  {

    Console.WriteLine("The No. "+IndexOf(m));

    do{

      Console.WriteLine(....);

    }while(...)

  }

}

posted @ 2017-09-30 10:24  Javi  阅读(173)  评论(0编辑  收藏  举报