How does the following LINQ statement work?

后端 未结 5 1232
南旧
南旧 2021-01-29 22:24

How does the following LINQ statement work?

Here is my code:

var list = new List{1,2,4,5,6};
var even = list.Where(m => m%2 == 0);
list.Add         


        
5条回答
  •  北恋
    北恋 (楼主)
    2021-01-29 22:39

    When you use an IEnumerable<> obtained from LINQ, only is created an Enumerator class and the iteration only start when you use it in some walk.

提交回复
热议问题