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; |
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 Email | |
{ | |
public Email(string emailAddress) | |
{ | |
Guard.Against.InvalidEmail(emailAddress); | |
EmailAddress = emailAddress; | |
} | |
public string EmailAddress { get; } |
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 Name | |
{ | |
public Name(string firstName, string lastName = "") | |
{ | |
Guard.Against.NullOrWhiteSpace(firstName, nameof(firstName)); | |
FirstName = firstName; | |
LastName = lastName; | |
} |
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 Lead | |
{ | |
public Lead(string name, string email) | |
{ | |
Name = name; | |
Email = email; | |
_segments = new List<Segment>(); | |
} | |
public string Name { get; } |
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 Lead | |
{ | |
// Initializing Segments to avoid an exception. | |
public Lead(string name, string email) | |
{ | |
Name = name; | |
Email = email; | |
_segments = new List<Segment>(); | |
} | |
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 Lead | |
{ | |
// The minimum data needed to create a Lead instance. | |
// The name and e-mail are the minimum necessary for a Lead to exist. Remember? | |
public Lead(string name, string email) | |
{ | |
Name = name; | |
Email = email; | |
} | |
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 Lead | |
{ | |
public string Name { get; set; } | |
public string Email { get; set; } | |
public IList<Segment> Segments { get; set; } | |
public string Company { get; set; } |
NewerOlder