Esempio n. 1
0
 /// <summary>Returns true if the postal code is valid for the specified country, otherwise false.</summary>
 /// <param name="postalcode">
 /// The postal code to test.
 /// </param>
 /// <remarks>
 /// Returns false if the country does not have postal codes.
 /// </remarks>
 public bool IsValid(string postalcode)
 {
     return
         (!string.IsNullOrEmpty(postalcode) &&
          HasPostalCode &&
          ValidationPattern.IsMatch(Parsing.ClearSpacingAndMarkup(postalcode)));
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ResourceGroupOperations"/> class.
        /// </summary>
        /// <param name="options"> The client parameters to use in these operations. </param>
        /// <param name="rgName"> The name of the resource group to use. </param>
        internal ResourceGroupOperations(SubscriptionOperations options, string rgName)
            : base(options, $"{options.Id}/resourceGroups/{rgName}")
        {
            if (rgName.Length > 90)
            {
                throw new ArgumentOutOfRangeException("ResourceGroupName cannot be longer than 90 characters.");
            }

            if (!ValidationPattern.IsMatch(rgName))
            {
                throw new ArgumentException("The name of the resource group can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.");
            }
        }