Skip to content

Instantly share code, notes, and snippets.

@maiconheck
Last active June 20, 2023 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maiconheck/d2ce25e29f9b3009224616b1279de233 to your computer and use it in GitHub Desktop.
Save maiconheck/d2ce25e29f9b3009224616b1279de233 to your computer and use it in GitHub Desktop.
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