We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d527f1 commit 205cd97Copy full SHA for 205cd97
1 file changed
src/Codebreaker.WinUI/Helpers/LinqExtensions.cs
@@ -0,0 +1,22 @@
1
+namespace System.Linq;
2
+
3
+internal static class LinqExtensions
4
+{
5
+ public static IEnumerable<T> Foreach<T>(this IEnumerable<T> enumerable, Action<T> action)
6
+ {
7
+ foreach (var item in enumerable)
8
+ action(item);
9
10
+ return enumerable;
11
+ }
12
13
+ public static IEnumerable<T> Foreach<T>(this IEnumerable<T> enumerable, Action<T, int> action)
14
15
+ int i = 0;
16
17
18
+ action(item, i++);
19
20
21
22
+}
0 commit comments