public List <Person> Search(string authToken, string surname, string givenName) { var searchString = ""; if (!string.IsNullOrEmpty(surname)) { searchString += $" surname:{surname}~ "; } if (!string.IsNullOrEmpty(givenName)) { searchString += $" givenName:{givenName}~ "; } var encoded = Uri.EscapeDataString(searchString); // Pass in the auth token to our familysearch api var ft = new FamilySearchSDK(authToken, "NotPassed", "FamilySearchAncestorMap.Core", "1.0.0", _config.Value.Environment); var searchResult = ft.Get("/platform/tree/search?q=" + encoded, MediaType.X_GEDCOMX_ATOM_JSON).Result; var list = new List <Person>(); foreach (var e in searchResult.entries) { var p = e.content.gedcomx.persons[0]; list.Add(new Person() { Id = p.id, Name = p.display.name, Birth = p.display.birthPlace + " on " + p.display.birthDate, Death = p.display.deathPlace + " on " + p.display.deathDate, }); } return(list); }