Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
var serviceClient = new ServiceClient("mykey", "http://data.nzor.org.nz");
   
var searchRequest = new SearchRequest();

searchRequest.Query = "lich*";
searchRequest.PageSize = 10;

var searchResponse = serviceClient.Search(searchRequest);

foreach (var result in searchResponse.Results)
{
    Console.WriteLine(result.Name.FullName);
}

Show the classification hierarchy for a name record

The following code enumerates the classification hierarchy for a name. The name information for each ancestor only includes the basic details for display so it may be necessary to make a separate call for each record using the name Id to obtain more details information.

Code Block
var serviceClient = new ServiceClient("mykey", "http://data.nzor.org.nz");
var name = serviceClient.GetName(new Guid("000018af-1183-46f7-8d80-0729ae07401f"));

Console.WriteLine(name.FullName);

Console.WriteLine();

foreach (var ancestorName in name.ClassificationHierarchy)
{
    Console.WriteLine(String.Format("{0}: {1}", ancestorName.Rank, ancestorName.FullName));
}
Console.ReadKey();