Exemple #1
0
        private static IContact ToContact(UpdateSolutionContactViewModel contact) =>
        contact?.HasData() == true ? new ContactDto
        {
            Department  = contact.Department,
            FirstName   = contact.FirstName,
            LastName    = contact.LastName,
            Email       = contact.Email,
            PhoneNumber = contact.PhoneNumber
        }

                : null;
Exemple #2
0
 internal static MaxLengthValidator ValidateContact(this MaxLengthValidator validator, UpdateSolutionContactViewModel contact, string contactTag)
 => validator
 .Validate(contact?.FirstName, FirstNameMaxLength, $"{contactTag}-first-name")
 .Validate(contact?.LastName, LastNameMaxLength, $"{contactTag}-last-name")
 .Validate(contact?.Email, EmailMaxLength, $"{contactTag}-email-address")
 .Validate(contact?.PhoneNumber, PhoneMaxLength, $"{contactTag}-phone-number")
 .Validate(contact?.Department, DepartmentMaxLength, $"{contactTag}-department-name");