Export (0) Print
Expand All

DataServiceContext Constructor

Initializes a new instance of the DataServiceContext class by using the specified baseURI.

Namespace:  System.Data.Services.Client
Assembly:  System.Data.Services.Client (in System.Data.Services.Client.dll)

public DataServiceContext(
	Uri serviceRoot
)

Parameters

serviceRoot
Type: System.Uri
An absolute URI that identifies the root of a data service.

ExceptionCondition
ArgumentNullException

When serviceRoot is null (Nothing in Visual Basic).

ArgumentException

When serviceRoot is not an absolute, well-formed URI, does not begin with http or https, or contains a query or query fragment.

The client library expects the baseURI to point to the root of a data service, but it does not issue a request to validate it. If the baseURI does not determine the root of the service, the behavior of the client library is undefined.

When run within Silverlight, a relative path may be used for baseUri. In this case, the path is relative to the authority (scheme + host + port) section of the URI for the page hosting the Silverlight control.

A URI with a trailing slash is the same as one without the trailing character.

For examples that use DataServiceContext, see WCF Data Services (Silverlight).

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2015 Microsoft