Open sandboxFocus

Class CreditCardAttribute

Custom attribute that, when added to a field, property or parameter, throws an ArgumentException if the target is assigned a value that is not a valid credit card number. If the target is a nullable type, If the target is a nullable type, null strings are accepted and do not throw an exception.

Inheritance
CreditCardAttribute
Namespace: Metalama.Patterns.Contracts
Assembly: Metalama.Patterns.Contracts.dll
Syntax
public sealed class CreditCardAttribute : ContractBaseAttribute, IAspect<IParameter>, IEligible<IParameter>, IAspect<IFieldOrPropertyOrIndexer>, IEligible<IFieldOrPropertyOrIndexer>, IConditionallyInheritableAspect, IAspect, ICompileTimeSerializable, ITemplateProvider

Constructors

Name Description
CreditCardAttribute()

Initializes a new instance of the CreditCardAttribute class.

Methods

Name Description
BuildEligibility(IEligibilityBuilder<IFieldOrPropertyOrIndexer>)

Configures the eligibility of the aspect or attribute. Implementations are not allowed to reference non-static members. Implementations must call the implementation of the base class if it exists.

BuildEligibility(IEligibilityBuilder<IParameter>)

Configures the eligibility of the aspect or attribute. Implementations are not allowed to reference non-static members. Implementations must call the implementation of the base class if it exists.

Validate(dynamic?)

See Also