Skip to content
Docs Try Aspire
Docs Try

NameValidationPolicyAnnotation Properties

Class Properties 5 members
Represents an annotation that customizes the name validation rules applied to a resource when it is added to the application model.
MaxLength Section titled MaxLength nullable int?
Gets the maximum allowed length for the resource name, or null to disable length validation. Defaults to ModelName.DefaultMaxLength.
public int? MaxLength { get; init; }
ValidateAllowedCharacters Section titled ValidateAllowedCharacters bool
Gets a value indicating whether to validate that the name contains only ASCII letters, digits, and hyphens. Defaults to true.
public bool ValidateAllowedCharacters { get; init; }
ValidateNoConsecutiveHyphens Section titled ValidateNoConsecutiveHyphens bool
Gets a value indicating whether to validate that the name does not contain consecutive hyphens. Defaults to true.
public bool ValidateNoConsecutiveHyphens { get; init; }
ValidateNoTrailingHyphen Section titled ValidateNoTrailingHyphen bool
Gets a value indicating whether to validate that the name does not end with a hyphen. Defaults to true.
public bool ValidateNoTrailingHyphen { get; init; }
ValidateStartsWithLetter Section titled ValidateStartsWithLetter bool
Gets a value indicating whether to validate that the name starts with an ASCII letter. Defaults to true.
public bool ValidateStartsWithLetter { get; init; }