コード例 #1
0
 public static void CopyFromContact(this ContactV1DTO to, Contact from)
 {
     to.ContactId    = from.ContactId;
     to.ContactName  = from.ContactName;
     to.PhoneNumber  = from.PhoneNumber;
     to.EmailAddress = from.EmailAddress;
 }
コード例 #2
0
        public static Contact ToContact(this ContactV1DTO item)
        {
            if (item == null)
            {
                throw new ArgumentException(nameof(item));
            }

            Contact contact = new Contact();

            contact.CopyFromContactV1DTO(item);
            return(contact);
        }
コード例 #3
0
        public static ContactV1DTO ToContactV1DTO(this Contact item)
        {
            if (item == null)
            {
                throw new ArgumentException(nameof(item));
            }

            ContactV1DTO contactV1DTO = new ContactV1DTO();

            contactV1DTO.CopyFromContact(item);
            return(contactV1DTO);
        }