IsNotIn
Determines if an instance is not contained in a sequence. Is the equivalent of Contains == false, but allows a more fluent reading "if item is not in list", specially useful in LINQ extension methods like Where.
Source
public static bool IsNotIn<T>(this T keyObject, IEnumerable<T> collection)
{
return keyObject.IsIn(collection) == false;
}
Example
var exceptionList = new List<string> { "exception1", "exception2" };
var query = myEntities.MyEntity
.Select(e => e.Name)
.Where(e => e.IsNotIn(exceptionList));