public PrimaryAddressDTO(PrimaryAddress primaryAddress) { Id = primaryAddress.Id; Street = primaryAddress.Street; StreetNumber = primaryAddress.StreetNumber; //Person = new PersonDTO(primaryAddress.Person); Zip = new ZipDTO(primaryAddress.Zip); }
public AddressDTO(Address address) { Id = address.Id; Street = address.Street; StreetNumber = address.StreetNumber; Zip = new ZipDTO(address.Zip); //Vi får ikke langt people over i den liste i address korrekt, derfor er den tom //People = new List<string>(); //foreach (Person p in address.People) //{ // People.Add(p.FirstName + " " + p.MiddleName + " " + p.LastName); //} PeopleAtAddress = new List <string>(); foreach (PersonAddress pa in address.Addresses) { PeopleAtAddress.Add(pa.Person.FirstName + " " + pa.Person.LastName + ": " + pa.Type); } }