Exemple #1
0
        public static Data.Person MapDtoToEntity(DTOs.Person source)
        {
            var destination = new Data.Person
            {
                Id       = source.Id,
                Address  = source.Address,
                Address2 = source.Address2,
                City     = source.City,
                Dob      = source.Dob,
                FName    = source.FName,
                LName    = source.LName,
                Postcode = source.Postcode,
                Suburb   = source.Suburb
            };

            //if (!source.PolicyHolders.Any()) return destination;
            //foreach (var policyHolder in source.PolicyHolders)
            //{
            //    destination.PolicyHolders.Add(PolicyHolderMapping.MapDtoToEntity(policyHolder));
            //}

            return(destination);
        }
Exemple #2
0
        public static DTOs.Person MapEntityToDto(Person source)
        {
            var destination = new DTOs.Person
            {
                Id          = source.Id,
                Address     = source.Address,
                Address2    = source.Address2,
                City        = source.City,
                Dob         = source.Dob,
                FName       = source.FName,
                LName       = source.LName,
                Postcode    = source.Postcode,
                Suburb      = source.Suburb,
                DisplayName = $"{source.LName}, {source.FName} of {source.City}, {source.Suburb}"
            };

            //if (!source.PolicyHolders.Any()) return destination;
            //foreach (var policyHolder in source.PolicyHolders)
            //{
            //    destination.PolicyHolders.Add(PolicyHolderMapping.MapEntityToDto(policyHolder));
            //}

            return(destination);
        }
Exemple #3
0
 public void Update(DTOs.Person personDto)
 {
     this.Name    = personDto.Name;
     this.Surname = personDto.Surname;
     this.Age     = personDto.Age;
 }