Filter to values in collection in one query
- by dotnetdev
Hi,
I have the following LINQ query:
List<string> Types = (List<string>) Directory.GetFiles(@"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727")
Where(x => System.IO.Path.GetFileNameWithoutExtension(x).Contains("Microsoft"))
.ToList<string>();
How could I modify this so it can only get the values stored in a collection, without writing another LINQ query (which I assume will impact performance?)?
Thanks