Skip to main content
๐Ÿ› Bug HuntC# C# / .NET Mediumโšก+20 XP

LINQ Deferred Execution

The query result changes unexpectedly after modification.

๐Ÿ› Find the bug
1var query = numbers.Where(n => n > 5);
2numbers.Add(10);
3var count = query.Count();
๐Ÿ› The bug is on line 1

๐Ÿ”ง Select the correct fix: