Beispiel #1
0
        public static ContactModelExtended ConvertToContactModel(this CustomerContact customerContact)
        {
            if (customerContact == null)
            {
                return(null);
            }

            return(new ContactModelExtended
            {
                PrimaryKeyId = customerContact.PrimaryKeyId.Value,
                Addresses = customerContact.ContactAddresses.Select(a => a.ConvertToAddressModel()).ToList(),
                FirstName = customerContact.FirstName,
                LastName = customerContact.LastName,
                Email = customerContact.Email,
                RegistrationSource = customerContact.RegistrationSource,
                MetaFields =
                    customerContact.GetMetaFields(new List <string>
                {
                    "FirstName",
                    "LastName",
                    "Email",
                    "RegistrationSource"
                })
            });
        }