Moved extensions
This commit is contained in:
parent
c505889f79
commit
df196ae632
4 changed files with 19 additions and 2 deletions
19
TShockAPI/Extensions/LinqExt.cs
Normal file
19
TShockAPI/Extensions/LinqExt.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace TShockAPI
|
||||
{
|
||||
public static class LinqExt
|
||||
{
|
||||
public static void ForEach<T>(this IEnumerable<T> source, Action<T> action)
|
||||
{
|
||||
if (source == null) throw new ArgumentNullException("source");
|
||||
if (action == null) throw new ArgumentNullException("action");
|
||||
|
||||
foreach (T item in source)
|
||||
action(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue