Index: DamEngine/trunk/src/Deltares.DamEngine.Data/General/Specifications/NotSpecification.cs =================================================================== diff -u -r4000 -r4052 --- DamEngine/trunk/src/Deltares.DamEngine.Data/General/Specifications/NotSpecification.cs (.../NotSpecification.cs) (revision 4000) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/General/Specifications/NotSpecification.cs (.../NotSpecification.cs) (revision 4052) @@ -19,33 +19,32 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -namespace Deltares.DamEngine.Data.General.Specifications +namespace Deltares.DamEngine.Data.General.Specifications; + +public class NotSpecification : CompositeSpecification { - public class NotSpecification : CompositeSpecification + private readonly ISpecification specification; + + public NotSpecification(ISpecification specification) { - private readonly ISpecification specification; + this.specification = specification; + } - public NotSpecification(ISpecification specification) + /// + /// Determines whether the candidate satisfies the specification. + /// + /// The candidate to test. + /// + /// true if the candidate satisfies the specification otherwise, false. + /// + public override bool IsSatisfiedBy(TCandidate candidate) + { + bool satisfied = !(specification.IsSatisfiedBy(candidate)); + if (!satisfied) { - this.specification = specification; + Description = specification.Description; } - /// - /// Determines whether the candidate satisfies the specification. - /// - /// The candidate to test. - /// - /// true if the candidate satisfies the specification otherwise, false. - /// - public override bool IsSatisfiedBy(TCandidate candidate) - { - bool satisfied = !(specification.IsSatisfiedBy(candidate)); - if (!satisfied) - { - Description = specification.Description; - } - - return satisfied; - } + return satisfied; } } \ No newline at end of file