diff --git a/Apewer/CollectionUtility.cs b/Apewer/CollectionUtility.cs index b074722..e809a2e 100644 --- a/Apewer/CollectionUtility.cs +++ b/Apewer/CollectionUtility.cs @@ -127,6 +127,12 @@ namespace Apewer } } + /// 检查当前元素是否存在于集合。 + public static bool In(this T item, IEnumerable collection) => Contains(collection, item); + + /// 检查当前元素是否存在于集合。 + public static bool In(this T item, params T[] collection) => Contains(collection, item); + #endregion #region 类型转换