//////////////////////////////////////////////////////////////////////////////////////////////// // And //////////////////////////////////////////////////////////////////////////////////////////////// public EnumerableMember <TSource, TNextMember> And <TNextMember>(Func <TMember, TNextMember> selector) => EnumerableMember.Create(_source, x => selector(_selector(x)));
public EnumerableMember <TSource, TMember> Not <TMemberValue>(TMemberValue value) where TMemberValue : IEquatable <TMemberValue>, TMember => EnumerableMember.Create(_source.Where(x => !Equals(value, _selector(x))), _selector);
public EnumerableMember <TSource, TMember> Not(Func <TMember, bool> predicate) => EnumerableMember.Create(_source.Where(x => !predicate(_selector(x))), _selector);
public EnumerableMember <TSource, TMember> Not(TMember value) => EnumerableMember.Create(_source.Where(x => !Equals(value, _selector(x))), _selector);
//public EnumerableMember<TSource, TMember> Is<TMemberValue>(Func<TMemberValue, bool> predicate) // where TMemberValue : IEquatable<TMemberValue>, TMember => // EnumerableMember.Create(_source.Where(x => predicate(_selector(x))), _selector); //////////////////////////////////////////////////////////////////////////////////////////////// // Not //////////////////////////////////////////////////////////////////////////////////////////////// public EnumerableMember <TSource, TMember> Not <TMemberType>() where TMemberType : TMember => EnumerableMember.Create(_source.Where(x => !(_selector(x) is TMemberType)), _selector);
//////////////////////////////////////////////////////////////////////////////////////////////// // Is //////////////////////////////////////////////////////////////////////////////////////////////// public EnumerableMember <TSource, TMemberType> Is <TMemberType>() where TMemberType : TMember => EnumerableMember.Create( _source.Where(x => _selector(x) is TMemberType), x => (TMemberType)_selector(x));
public static EnumerableMember <TSource, TChild> Member <TSource, TChild>( this IEnumerable <TSource> source, Func <TSource, TChild> selector) => EnumerableMember.Create(source, selector);
public static EnumerableMember <TSource, TSource> Element <TSource>( this IEnumerable <TSource> source) => EnumerableMember.Create(source, x => x);