Udostępnij za pośrednictwem


DataServiceCollection<T>.LoadAsync Method (IQueryable<T>)

Asynchronously loads the collection by executing a DataServiceQuery<TElement>.

Supported only by the WCF Data Services 5.0 client for Silverlight.

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

Syntax

'Declaration
Public Sub LoadAsync ( _
    query As IQueryable(Of T) _
)
'Usage
Dim instance As DataServiceCollection 
Dim query As IQueryable(Of T)

instance.LoadAsync(query)
public void LoadAsync(
    IQueryable<T> query
)
public:
void LoadAsync(
    IQueryable<T>^ query
)
member LoadAsync : 
        query:IQueryable<'T> -> unit
public function LoadAsync(
    query : IQueryable<T>
)

Parameters

Exceptions

Exception Condition
ArgumentException

When query is nulla null reference (Nothing in Visual Basic) or not a DataServiceQuery<TElement>.

InvalidOperationException

When a previous call to LoadAsync is not yet complete.

Remarks

Because the LoadAsync method is asynchronous, the method returns before a response to the data service is received. You must handle the LoadCompleted event to access the QueryOperationResponse<T> that contains information about the result of the load operation. Items are loaded into the collection when the load operation is complete, whether or not the LoadCompleted event is handled.

The LoadAsync method can be called only once on the UI thread. The method cannot be called again until after the LoadCompleted event is raised. The LoadCompleted event is raised whether or not the query succeeds.

See Also

Reference

DataServiceCollection<T> Class

LoadAsync Overload

System.Data.Services.Client Namespace