/// <summary> /// Create a new specification which is the negation of lhs /// </summary> /// <typeparam name="T">Candidate type of specification</typeparam> /// <returns>New specification negating this one</returns> /// <returns>New specification representing NOT rhs</returns> public static ISpecification <T> Not <T>(this ISpecification <T> rhs) { if (rhs is TrueSpecification <T> ) { return(new FalseSpecification <T>()); } if (rhs is FalseSpecification <T> ) { return(True <T>()); } return(NotSpecification <T> .Create(rhs)); }