Why Standard Extension Method on IEnumerables
问题 When i use a standard Extension Method on a List such as Where (...) the result is always IEnumerable , and when you decide to do a list operation such as Foreach() we need to Cast (not pretty) or use a ToList() extension method that (maybe) uses a new List that consumes more memory (is that right?): List<string> myList=new List<string>(){//some data}; ( Edit : this cast on't Work) myList.Where(p=>p.Length>5).Tolist().Foreach(...); or (myList.Where(p=>p.Length>5) as List<string>).Foreach(...)