A base aspect that can validate or change the value of fields, properties, indexers, and parameters.
public abstract class ContractAspect : Aspect, IAspect<IParameter>, IEligible<IParameter>, IAspect<IFieldOrPropertyOrIndexer>, IAspect, ICompileTimeSerializable, IEligible<IFieldOrPropertyOrIndexer>
A contract aspect can apply to the input or output data flow, or to both data flows, according to the ContractDirection value passed to the constructor. Since the current class does not know the value of this parameter before it is instantiated, this class cannot set the eligibility conditions using the BuildEligibility(IEligibilityBuilder<IFieldOrPropertyOrIndexer>) method. If a derived class targets a specific ContractDirection (i.e. if the choice is not left to the user), its implementation of BuildEligibility(IEligibilityBuilder<IFieldOrPropertyOrIndexer>) can call BuildEligibilityForDirection(IEligibilityBuilder<IFieldOrPropertyOrIndexer>, ContractDirection) methods. This means that eligibility can be checked upfront by the IDE before suggesting the code actions.
In any case, this aspect verifies the eligibility of the target with respect to the specific ContractDirection and target declaration. This verification cannot be skipped.
Initializes a new instance of the ContractAspect class.