|
123456789101112131415161718192021222324252627282930 |
-
- //
-
-
-
-
-
-
-
-
- namespace SafeCampus.Core.Extension;
-
- /// <summary>
- /// Linq扩展
- /// </summary>
- [SuppressSniffer]
- public static class LinqExtension
- {
- /// <summary>
- /// 是否都包含
- /// </summary>
- /// <typeparam name="T"></typeparam>
- /// <param name="first">第一个列表</param>
- /// <param name="second">第二个列表</param>
- /// <returns></returns>
- public static bool ContainsAll<T>(this List<T> first, List<T>? second)
- {
- return second.All(s => first.Any(f => f.Equals(s)));
- }
- }
|