Skip to content

Instantly share code, notes, and snippets.

@maiconheck
Last active June 20, 2023 13:45
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/11cef28501cc0fae5568470c86f0c75b to your computer and use it in GitHub Desktop.
Save maiconheck/11cef28501cc0fae5568470c86f0c75b to your computer and use it in GitHub Desktop.
[3º Improvement]
public class Lead
{
public Lead(string name, string email)
{
Name = name;
Email = email;
_segments = new List<Segment>();
}
public string Name { get; }
public string Email { get; }
private readonly List<Segment> _segments;
public IReadOnlyList<Segment> Segments => _segments.ToList();
public string PhoneNumber { get; private set; }
public string Address { get; private set; }
public bool? Gender { get; private set; }
public DateTime? BirthDate { get; private set; }
public void CompleteInfo(string phoneNumber, string address, bool gender, DateTime birthDate)
{
PhoneNumber = phoneNumber;
Address = address;
Gender = gender;
BirthDate = birthDate;
}
public void AddSegment(Segment segment)
{
_segments.Add(segment);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment