Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 13051eb

Browse files
committed
Add new InList and InArray extension methods
1 parent 5e7adfe commit 13051eb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/ServiceStack.Text/ListExtensions.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,15 @@ public static T[] NewArray<T>(this T[] array, T with = null, T without = null) w
6262

6363
return to.ToArray();
6464
}
65+
66+
public static List<T> InList<T>(this T value)
67+
{
68+
return new List<T> { value };
69+
}
70+
71+
public static T[] InArray<T>(this T value)
72+
{
73+
return new[] { value };
74+
}
6575
}
6676
}

0 commit comments

Comments
 (0)