Open sandboxFocus

Class ContractHelpers

Provides runtime helper methods and configurable delegates used by contract aspects.

Inheritance
ContractHelpers
Namespace: Metalama.Patterns.Contracts
Assembly: Metalama.Patterns.Contracts.dll
Syntax
public static class ContractHelpers
Remarks

This class exposes configurable delegates and regular expressions that control the validation logic of certain contracts. You can customize these properties during application startup to change the validation behavior.

Properties

Name Description
EmailRegex

Gets or sets the regular expression used by EmailAttribute.

IsValidCreditCardNumber

Gets or sets the delegate used by CreditCardAttribute.

PhoneRegex

Gets or sets the regular expression used by PhoneAttribute.

UrlRegex

Gets or sets the regular expression used by UrlAttribute.

Methods

Name Description
GetRegex(string, RegexOptions)

Gets a cached regular expression. This method is used by JetBrains.Annotations.RegexPatternAttribute.

See Also