I\'m trying to come up with an implementation for NotOfType
, which has a readable call syntax. NotOfType
should be the complement to OfType&l
How about
animals.NotOf(typeof(Giraffe));
Alternatively, you can split the generic parameters across two methods:
animals.NotOf().Type();
public static NotOfHolder NotOf(this IEnumerable source);
public class NotOfHolder : IHideObjectMembers {
public IEnumerable NotOf();
}
Also, you need to decide whether to also exclude inherited types.