Created
April 14, 2015 00:00
-
-
Save jchandra74/ecfada097b9793760027 to your computer and use it in GitHub Desktop.
Generic LINQ Extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace __NAMESPACE__ | |
{ | |
using System.Linq; | |
using System.Collections.Generic; | |
/// <summary> | |
/// Check if expected list items are all in master list | |
/// </summary> | |
/// <typeparam name="T">Generic Type</typeparam> | |
/// <param name="a">Master list</param> | |
/// <param name="b">Expected list items</param> | |
/// <returns>true if all items in b are in a</returns> | |
public static class GenericCollectionExtensions | |
{ | |
public static bool ContainsAll<T>(this List<T> a, List<T> b) | |
{ | |
return !b.Except(a).Any(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment