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); }
public static DTOs.Dependent MapEntityToDto(Dependent source) { var destination = new DTOs.Dependent { Id = source.Id, Active = source.Active, PersonId = source.PersonId, PolicyHolderId = source.PolicyHolderId, PolicyHolderName = $"{source.PolicyHolder?.Person?.LName}, {source.PolicyHolder?.Person?.FName}" }; //if (source.PolicyHolder != null) //{ // destination.PolicyHolder = PolicyHolderMapping.MapEntityToDto(source.PolicyHolder); //} if (source.Person != null) { destination.Person = PersonMapping.MapEntityToDto(source.Person); } return(destination); }