Example #1
0
        public static void MapToExisting(this Domain.Accountholder source, Person target)
        {
            if (source == null)
            {
                target = null;
            }
            else if (target == null)
            {
                target = new Person();
            }

            target.FName = source.FirstName;
            target.LName = source.LastName;

            source.ResidenceAddress.MapToExisting(target);
        }
Example #2
0
        public static Person Map(this Domain.Accountholder source)
        {
            if (source == null)
            {
                return(null);
            }

            var target = new Person
            {
                FName = source.FirstName,
                LName = source.LastName,
            };

            source.ResidenceAddress.MapToExisting(target);

            return(target);
        }
Example #3
0
        public static Domain.Accountholder Map(this Person source)
        {
            if (source == null)
            {
                return(null);
            }

            var target = new Domain.Accountholder
            {
                FirstName = source.FName,
                LastName  = source.LName,

                ResidenceAddress = source.MapToAddress(),
            };

            return(target);
        }