public Predicate <T> BuildFilter <T>(Func <T, int> relationType) { List <Predicate <T> > relationFilters = new List <Predicate <T> >(); if (Blood) { relationFilters.Add(FilterUtils.IntFilter <T>(relationType, Individual.BLOOD)); } if (Directs) { relationFilters.Add(FilterUtils.IntFilter <T>(relationType, Individual.DIRECT)); } if (Marriage) { relationFilters.Add(FilterUtils.IntFilter <T>(relationType, Individual.MARRIAGE)); } if (MarriedToDB) { relationFilters.Add(FilterUtils.IntFilter <T>(relationType, Individual.MARRIEDTODB)); } if (Unknown) { relationFilters.Add(FilterUtils.IntFilter <T>(relationType, Individual.UNKNOWN)); } return(FilterUtils.OrFilter <T>(relationFilters)); }