private void ProcessFamilies() { Families = new List <Family>(); foreach (var gedcomRecord in _document.FamilyRecords) { var familyRecord = (GEDCOMFamilyRecord)gedcomRecord; var family = new Family { Id = familyRecord.GetId(), HusbandId = GEDCOMUtil.GetId(familyRecord.Husband), WifeId = GEDCOMUtil.GetId(familyRecord.Wife), TreeId = DEFAULT_TREE_ID }; ProcessFacts(family, familyRecord.Events); ProcessMultimedia(family, familyRecord.Multimedia); ProcessNotes(family, familyRecord.Notes); ProcessCitations(family, familyRecord.SourceCitations); foreach (string child in familyRecord.Children) { var childId = GEDCOMUtil.GetId(child); if (!string.IsNullOrEmpty(childId)) { var individual = Individuals.SingleOrDefault(ind => ind.Id == childId); if (individual != null) { individual.MotherId = family.WifeId; individual.FatherId = family.HusbandId; } } } Families.Add(family); } }