Share via


DataServiceContext.Execute Method

Definition

Overloads

Execute(Uri, String, OperationParameter[])

Sends a request to the data service to execute a specific URI by using a specific HTTP method.

Execute<T>(DataServiceQueryContinuation<T>)

Sends a request to the data service to retrieve the next page of data in a paged query result.

Execute<TElement>(Uri)

Sends a request to the data service to execute a specific URI.

Execute<TElement>(Uri, String, OperationParameter[])

Sends a request to the data service to execute a specific URI by using a specific HTTP method.

Execute<TElement>(Uri, String, Boolean, OperationParameter[])

Sends a request to the data service to execute a specific URI by using a specific HTTP method.

Execute(Uri, String, OperationParameter[])

Sends a request to the data service to execute a specific URI by using a specific HTTP method.

public virtual Microsoft.OData.Client.OperationResponse Execute (Uri requestUri, string httpMethod, params Microsoft.OData.Client.OperationParameter[] operationParameters);
abstract member Execute : Uri * string * Microsoft.OData.Client.OperationParameter[] -> Microsoft.OData.Client.OperationResponse
override this.Execute : Uri * string * Microsoft.OData.Client.OperationParameter[] -> Microsoft.OData.Client.OperationResponse
Public Overridable Function Execute (requestUri As Uri, httpMethod As String, ParamArray operationParameters As OperationParameter()) As OperationResponse

Parameters

requestUri
Uri

The URI to which the query request will be sent. The URI may be any valid data service URI. Can contain $ query parameters.

httpMethod
String

The HTTP data transfer method used by the client.

operationParameters
OperationParameter[]

The operation parameters used.

Returns

The response of the operation.

Exceptions

null requestUri

The httpMethod is not GET, POST or DELETE.

problem materializing results of query into objects

failure to get response for requestUri

Remarks

This overload expects the requestUri to end with a ServiceOperation or ServiceAction that returns void.

Applies to

Execute<T>(DataServiceQueryContinuation<T>)

Sends a request to the data service to retrieve the next page of data in a paged query result.

public virtual Microsoft.OData.Client.QueryOperationResponse<T> Execute<T> (Microsoft.OData.Client.DataServiceQueryContinuation<T> continuation);
abstract member Execute : Microsoft.OData.Client.DataServiceQueryContinuation<'T> -> Microsoft.OData.Client.QueryOperationResponse<'T>
override this.Execute : Microsoft.OData.Client.DataServiceQueryContinuation<'T> -> Microsoft.OData.Client.QueryOperationResponse<'T>
Public Overridable Function Execute(Of T) (continuation As DataServiceQueryContinuation(Of T)) As QueryOperationResponse(Of T)

Type Parameters

T

The type returned by the query.

Parameters

continuation
DataServiceQueryContinuation<T>

A DataServiceQueryContinuation<T> object that represents the next page of data to return from the data service.

Returns

The response that contains the next page of data in the query result.

Applies to

Execute<TElement>(Uri)

Sends a request to the data service to execute a specific URI.

public virtual System.Collections.Generic.IEnumerable<TElement> Execute<TElement> (Uri requestUri);
abstract member Execute : Uri -> seq<'Element>
override this.Execute : Uri -> seq<'Element>
Public Overridable Function Execute(Of TElement) (requestUri As Uri) As IEnumerable(Of TElement)

Type Parameters

TElement

The type that the query returns.

Parameters

requestUri
Uri

The URI to which the query request will be sent. The URI may be any valid data service URI. Can contain $ query parameters.

Returns

IEnumerable<TElement>

The results of the query operation.

Exceptions

When a response is not received from a request to the requestUri.

When requestUri is null.

When requestUri is not a valid URI for the data service.

When an error is raised either during execution of the request or when it converts the contents of the response message into objects.

When the data service returns an HTTP 404: Resource Not Found error.

Applies to

Execute<TElement>(Uri, String, OperationParameter[])

Sends a request to the data service to execute a specific URI by using a specific HTTP method.

public virtual System.Collections.Generic.IEnumerable<TElement> Execute<TElement> (Uri requestUri, string httpMethod, params Microsoft.OData.Client.OperationParameter[] operationParameters);
abstract member Execute : Uri * string * Microsoft.OData.Client.OperationParameter[] -> seq<'Element>
override this.Execute : Uri * string * Microsoft.OData.Client.OperationParameter[] -> seq<'Element>
Public Overridable Function Execute(Of TElement) (requestUri As Uri, httpMethod As String, ParamArray operationParameters As OperationParameter()) As IEnumerable(Of TElement)

Type Parameters

TElement

The type returned by the query.

Parameters

requestUri
Uri

The URI to which the query request will be sent. The URI may be any valid data service URI. Can contain $ query parameters.

httpMethod
String

The HTTP data transfer method used by the client.

operationParameters
OperationParameter[]

The operation parameters used.

Returns

IEnumerable<TElement>

Returns IEnumerable<T>.

Exceptions

null requestUri

The httpMethod is not GET nor POST.

problem materializing results of query into objects

failure to get response for requestUri

Applies to

Execute<TElement>(Uri, String, Boolean, OperationParameter[])

Sends a request to the data service to execute a specific URI by using a specific HTTP method.

public virtual System.Collections.Generic.IEnumerable<TElement> Execute<TElement> (Uri requestUri, string httpMethod, bool singleResult, params Microsoft.OData.Client.OperationParameter[] operationParameters);
abstract member Execute : Uri * string * bool * Microsoft.OData.Client.OperationParameter[] -> seq<'Element>
override this.Execute : Uri * string * bool * Microsoft.OData.Client.OperationParameter[] -> seq<'Element>
Public Overridable Function Execute(Of TElement) (requestUri As Uri, httpMethod As String, singleResult As Boolean, ParamArray operationParameters As OperationParameter()) As IEnumerable(Of TElement)

Type Parameters

TElement

The type returned by the query.

Parameters

requestUri
Uri

The URI to which the query request will be sent. The URI may be any valid data service URI. Can contain $ query parameters.

httpMethod
String

The HTTP data transfer method used by the client.

singleResult
Boolean

Attribute used on service operations to specify that they return a single instance of their return element.

operationParameters
OperationParameter[]

The operation parameters used.

Returns

IEnumerable<TElement>

Returns IEnumerable<T>.

Exceptions

null requestUri

The httpMethod is not GET nor POST.

problem materializing results of query into objects

failure to get response for requestUri

Applies to