コード例 #1
0
        public static string ToReason(
            this AddressValidationError error)
        {
            switch (error)
            {
            case AddressValidationError.AddressIsBlacklisted:
                return("Address is blacklisted");

            case AddressValidationError.ChecksumIsInvalid:
                return("Checksum is invalid");

            case AddressValidationError.FormatIsInvalid:
                return("Format is invalid");

            default:
                throw new ArgumentOutOfRangeException(nameof(error), error, null);
            }
        }
コード例 #2
0
 public static AddressValidationResult AddressIsInvalid(AddressValidationError error)
 => new Error(error);
コード例 #3
0
 internal Error(
     AddressValidationError type)
 {
     Type = type;
 }