DataServiceQuery<TElement>.Execute Method ()


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Executes the query and returns the results as a collection that implements IEnumerable.

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

public IEnumerable<TElement> Execute()

Return Value

Type: System.Collections.Generic.IEnumerable<TElement>

An IEnumerable<T> in which T represents the type of the query results.

Exception Condition

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

When iterating over the returned collection, if an object is encountered in the input stream that cannot be deserialized to an instance of T then a NotSupportedException is thrown.

.NET Framework
Available since 3.5
Return to top