Share via


DataServiceCollection<T>.LoadAsync Method

Definition

Overloads

LoadAsync()

Asynchronously loads items into the collection, when it represents the navigation property of an entity.Supported only by the WCF Data Services 5.0 client for Silverlight.

LoadAsync(IQueryable<T>)

Asynchronously loads the collection by executing a DataServiceQuery<TElement>.Supported only by the WCF Data Services 5.0 client for Silverlight.

LoadAsync(Uri)

Loads the collection asynchronously by loading the results from the request Uri.

LoadAsync()

Asynchronously loads items into the collection, when it represents the navigation property of an entity.Supported only by the WCF Data Services 5.0 client for Silverlight.

public void LoadAsync ();
member this.LoadAsync : unit -> unit
Public Sub LoadAsync ()

Exceptions

When the collection does not belong to a parent entity.-or-When the parent entity is not tracked by the DataServiceContext.-or-When a previous call to LoadAsync() is not yet complete.

Remarks

This method loads the content of a property represented by this DataServiceCollection. If this instance is not associated with any property and entity the method will fail. This method uses the event-based async pattern. The method returns immediately without waiting for the query to complete. Then it calls the handler of the LoadCompleted event exactly once on the UI thread. The event will be raised regradless if the query succeeded or not. This class only support one asynchronous operation in flight.

Applies to

LoadAsync(IQueryable<T>)

Asynchronously loads the collection by executing a DataServiceQuery<TElement>.Supported only by the WCF Data Services 5.0 client for Silverlight.

public void LoadAsync (System.Linq.IQueryable<T> query);
member this.LoadAsync : System.Linq.IQueryable<'T> -> unit
Public Sub LoadAsync (query As IQueryable(Of T))

Parameters

query
IQueryable<T>

The DataServiceQuery<TElement> that, when executed, returns the entities to load into the collection.

Exceptions

When query is null or not a DataServiceQuery<TElement>.

When a previous call to LoadAsync(IQueryable<T>) is not yet complete.

Remarks

This method uses the event-based async pattern. The method returns immediately without waiting for the query to complete. Then it calls the handler of the LoadCompleted event exactly once on the UI thread. The event will be raised regardless if the query succeeded or not. This class only support one asynchronous operation in flight.

Applies to

LoadAsync(Uri)

Loads the collection asynchronously by loading the results from the request Uri.

public void LoadAsync (Uri requestUri);
member this.LoadAsync : Uri -> unit
Public Sub LoadAsync (requestUri As Uri)

Parameters

requestUri
Uri

The request uri to download results from.

Remarks

This method uses the event-based async pattern. The method returns immediately without waiting for the query to complete. Then it calls the handler of the LoadCompleted event exactly once on the UI thread. The event will be raised regradless if the query succeeded or not. This class only support one asynchronous operation in flight.

Applies to