示例#1
0
 public int SavePerson(Contoso.Apps.Insurance.Data.DTOs.Person person)
 {
     using (var actions = new PersonActions())
     {
         var personModel = PersonMapping.MapDtoToEntity(person);
         actions.SavePerson(personModel);
         person.Id = personModel.Id;
     }
     return(person.Id);
 }
示例#2
0
 public int SavePerson(Data.DTOs.Person person)
 {
     using (var actions = new PersonActions(_connectionString))
     {
         var personModel = PersonMapping.MapDtoToEntity(person);
         actions.SavePerson(personModel);
         person.Id = personModel.Id;
     }
     return(person.Id);
 }
示例#3
0
        public static Dependent MapDtoToEntity(DTOs.Dependent source)
        {
            var destination = new Dependent
            {
                Id             = source.Id,
                Active         = source.Active,
                PersonId       = source.PersonId,
                PolicyHolderId = source.PolicyHolderId
            };

            //if (source.PolicyHolder != null)
            //{
            //    destination.PolicyHolder = PolicyHolderMapping.MapDtoToEntity(source.PolicyHolder);
            //}

            if (source.Person != null)
            {
                destination.Person = PersonMapping.MapDtoToEntity(source.Person);
            }

            return(destination);
        }