Пример #1
0
        public static NewInquiry Create(string firstName, string lastName, string emailAdress, string organizationName,
                                        string inquiryDescription, string bestPhoneNumber, string officePhoneNumber = null, string homePhoneNumber = null)
        {
            var personName        = new PersonName(firstName, lastName);
            var validEmailAddress = new ValidEmailAddress(emailAdress);

            return(new NewInquiry(personName, validEmailAddress, organizationName, inquiryDescription, bestPhoneNumber,
                                  homePhoneNumber));
        }
Пример #2
0
 public NewInquiry(PersonName inquiredBy, ValidEmailAddress emailAddress, string organizationName, string inquiryDescription, string bestPhoneNumber, string officePhoneNumber = null, string homePhoneNumber = null)
 {
     InquiredBy   = inquiredBy ?? throw new ArgumentNullException(nameof(inquiredBy));
     EmailAddress = emailAddress ?? throw new ArgumentNullException(nameof(emailAddress));
     if (string.IsNullOrWhiteSpace(organizationName))
     {
         throw new ArgumentNullException(nameof(organizationName));
     }
     if (string.IsNullOrWhiteSpace(inquiryDescription))
     {
         throw new ArgumentNullException(inquiryDescription);
     }
     if (string.IsNullOrWhiteSpace(bestPhoneNumber))
     {
         throw new ArgumentNullException(nameof(bestPhoneNumber));
     }
     OrganizationName   = organizationName;
     InquiryDescription = inquiryDescription;
     BestPhoneNumber    = bestPhoneNumber;
     OfficePhoneNumber  = officePhoneNumber;
     HomePhoneNumber    = homePhoneNumber;
 }