Last active
June 20, 2023 15:13
-
-
Save maiconheck/d2ce25e29f9b3009224616b1279de233 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PhoneNumber | |
{ | |
public PhoneNumber(string ddd, string number) | |
{ | |
Guard.Against | |
.NotMatch(ddd, @"^\d{2}$", nameof(ddd)) | |
.NotMatch(number, @"^\d{8}$|^\d{9}$", nameof(number)); | |
Ddd = ddd; | |
Number = number; | |
} | |
public string Ddd { get; } | |
public string Number { get; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment