MetaData
The Metadata interface supports the Search service by providing the available properties defined within the data universe.
Metadata returns a list of properties, based on the specified view, that outlines specific capabilities for each.
The capabilities are relevant when choosing specific search parameters such as selecting, filtering, naviagating, grouping, etc.
Syntax
IMetaDataDefinition Definition(Search.ExploreView view = Search.ExploreView.Entities)IMetaDataDefinition Definition(Search.View view)IMetaDataDefinition Definition(Search.LightView view)
Returned value
MetaDataDefinition object.
MetaDataDefinition Methods
IMetaDataDefinition View(Search.ExploreView view)
The supported View to search against the explore services.
The view is optional. Default: Search.ExploreView.Entities.
IMetaDataDefinition View(Search.View view)
The supported View to search against the full services.
The view is optional. Default: Search.ExploreView.Entities.
IMetaDataDefinition View(Search.LightView view)
The supported View to search against the light service.
The view is optional. Default: Search.ExploreView.Entities.
IMetaDataDefinition Closure(object closure)
Optionally, include a user-defined Closure to match specific requests and responses.
Usage
Below we have a provided a code snippet containing several search cases
// Get government corporation instrument metadata and select some specific table data
var response = MetaData.Definition(Search.View.GovCorpInstruments).GetData();
if (response.IsSuccess)
{
var table = response.Data.Table;
// Search for a specific property
var result = table.Select("Property = 'RCSAssetCategory'");
Console.WriteLine($"Property {result[0]["Property"]}:");
Console.WriteLine($"Navigable: {result[0]["Navigable"]}");
Console.WriteLine($"Sortable: {result[0]["Sortable"]}");
result = table.Select("Property = 'RCSCountryGenealogy'");
Console.WriteLine($"Property {result[0]["Property"]}:");
Console.WriteLine($"Navigable: {result[0]["Navigable"]}");
Console.WriteLine($"Sortable: {result[0]["Sortable"]}");
result = table.Select("Property = 'SPsRatingsScope.CurrentRatingRank'");
Console.WriteLine($"Property {result[0]["Property"]}:");
Console.WriteLine($"Navigable: {result[0]["Navigable"]}");
Console.WriteLine($"Sortable: {result[0]["Sortable"]}");
// Search for a specific nested property and all its sub properties
result = table.Select("Property LIKE 'RatingsScope.*'");
}
// Do a similar search using a light view
var response2 = MetaData.Definition(Search.LightView.GovCorpInstruments).GetData();