Data Service Metadata (ADO.NET Data Services Framework)

ADO.NET Data Services provide a metadata endpoint that returns a schema of resources and URIs deployed by the data service. Like Web Service Description Language (WSDL) for SOAP Web services, ADO.NET Data Services metadata provides enough information about a service to generate a strongly typed client library. By using the client library, an application can interact with the data as programmable classes that represent resources in the data service.

Conceptual Schema Definition Language (CSDL)

The language used to describe ADO.NET Data Services is the conceptual schema definition language (CSDL) defined by the ADO.NET Entity Data Model.

EDM-based Data Models

For an EDM based model, begin with the CSDL file from the EDM model, and continue according to the following steps:

  1. Add the ADO.NET Data Services namespace declaration to each Schema element: xmlns:dataweb = "xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"

  2. Add the following attribute to the EntityContainer element of the CSDL schema to represent the default Entity Container for the data service: m:IsDefaultEntityContainer="true"

  3. For each service operation declared by the service, insert a FunctionImport element into the CSDL schema in the default EntityContainer according to the following rules:

Function Import Element Value

Name Attribute

The method name of the service operation as specified in the DataService class.

ReturnType Attribute

The return type of the service operation as specified by the method signature in the DataService class.

The return type must be specified using EDM types. See the following table for a mapping of supported service operation return types to their equivalent EDM types.

Service operation return types are mapped to EDM types and must be specified using EDM types according to the supported return types in the following table.

EDM Type Service Operation Return Type

Edm.Binary

byte[]

Edm.Boolean

bool

Edm.Byte

byte

Edm.DateTime

DateTime

Edm.Decimal

Decimal

Edm.Double

double

Edm.Guid

Guid

Edm.Int16

Int16

Edm.Int32

Int32

Edm.Int64

Int64

Edm.SByte

SByte

Edm.Single

Single

Edm.String

String

Edm.Collection(<type>)

Not supported

ObjectQuery<T>

Not supported

Not Supported by EDM

Single Entity Type

Not Supported by EDM

Collection of Complex Types

See Also

Tags :


Page view tracker