private Func <PersonWithMetadata, Tuple <bool, bool, bool> > GetHasFatherHasMotherHasSpouse(FamilyModel familyModel) { return(person => { if (person.BooleanSamples == null || !person.BooleanSamples.ContainsKey(PersonStatisticKeys.HasFather) || !person.BooleanSamples.ContainsKey(PersonStatisticKeys.HasMother) || !person.BooleanSamples.ContainsKey(PersonStatisticKeys.HasSpouse)) { return familyModel.HasFatherHasMotherHasSpouse(person); } return new Tuple <bool, bool, bool>(person.BooleanSamples[PersonStatisticKeys.HasFather], person.BooleanSamples[PersonStatisticKeys.HasMother], person.BooleanSamples[PersonStatisticKeys.HasSpouse]); }); }