Skip to content
Nathan Baulch edited this page Jun 16, 2014 · 1 revision

The schema API provides a high level wrapper around XML schema metadata that simplifies the discovery of resources, properties and relationships at runtime.

Note: Silverlight, Windows 8 and Windows Phone don't support the System.Xml.Schema namespace and therefore cannot support this API.

The following example requests the top level dynamic adapter schema and outputs all the value property types and names for the contact resource.

var client = new SDataClient("http://example.com/sdata/slx/dynamic/-/")
    {
        UserName = "admin",
        Password = "password"
    };
var param = new SDataParameters {Path = "$schema"};
var results = await client.ExecuteAsync<SDataSchema>(param);
foreach (var prop in results.Content.ResourceTypes["Contact"].ValueProperties)
{
    Console.WriteLine(prop.Name + " - " + prop.Type.QualifiedName.Name);
}

More information on schema can be found in section 4 of the SData specification.

Clone this wiki locally