平安校园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
537 B

  1. //
  2. namespace SafeCampus.Core.Extension;
  3. /// <summary>
  4. /// Linq扩展
  5. /// </summary>
  6. [SuppressSniffer]
  7. public static class LinqExtension
  8. {
  9. /// <summary>
  10. /// 是否都包含
  11. /// </summary>
  12. /// <typeparam name="T"></typeparam>
  13. /// <param name="first">第一个列表</param>
  14. /// <param name="second">第二个列表</param>
  15. /// <returns></returns>
  16. public static bool ContainsAll<T>(this List<T> first, List<T>? second)
  17. {
  18. return second.All(s => first.Any(f => f.Equals(s)));
  19. }
  20. }