Created
May 23, 2022 12:26
-
-
Save lgolubyev/f778e60573a58cce0d5bbe1c37c50475 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void MyComponentLegacyMethod(List<int> masterCollection) | |
{ | |
// Without the ToList method this linq query would be executed twice | |
var result = masterCollection.Where(i => i > 100).ToList(); | |
Console.WriteLine(result.Count()); | |
Console.WriteLine(result.Average()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment