public static Predicate<T> FuncToPredicate<T>(this Func<T, bool> func)
{
return x => func(x);
}
public static Func<T, bool> PredicateToFunc<T>(this Predicate<T> predicate)
{
return x => predicate(x);
}
C# Func与Predicate互转
最新推荐文章于 2024-08-19 18:00:00 发布