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); }
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); }
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); }