LoadOperation<TEntity> Class
[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]
Represents an asynchronous load operation.
Inheritance Hierarchy
System.Object
System.ServiceModel.DomainServices.Client.OperationBase
System.ServiceModel.DomainServices.Client.LoadOperation
System.ServiceModel.DomainServices.Client.LoadOperation<TEntity>
Namespace: System.ServiceModel.DomainServices.Client
Assembly: System.ServiceModel.DomainServices.Client (in System.ServiceModel.DomainServices.Client.dll)
Syntax
'Declaration
Public NotInheritable Class LoadOperation(Of TEntity As Entity) _
Inherits LoadOperation
'Usage
Dim instance As LoadOperation(Of TEntity)
public sealed class LoadOperation<TEntity> : LoadOperation
where TEntity : Entity
generic<typename TEntity>
where TEntity : Entity
public ref class LoadOperation sealed : public LoadOperation
[<SealedAttribute>]
type LoadOperation<'TEntity when 'TEntity : Entity> =
class
inherit LoadOperation
end
JScript does not support generic types and methods.
Type Parameters
- TEntity
The entity type being loaded.
The LoadOperation<TEntity> type exposes the following members.
Properties
Name | Description | |
---|---|---|
AllEntities | Gets all the entities loaded by the operation, including any entities referenced by the top-level entities. (Inherited from LoadOperation.) | |
CanCancel | Gets a value that indicates whether this OperationBase is currently in a state that enables it to be canceled. (Inherited from OperationBase.) | |
Entities | Gets all the entities loaded by the operation, including any entities referenced by the top-level entities. | |
EntityQuery | Gets the EntityQuery for this load operation. | |
Error | Gets the operation error if the operation failed. (Inherited from OperationBase.) | |
HasError | Gets a value that indicates whether the operation failed. (Inherited from OperationBase.) | |
IsCanceled | Gets a value that indicates whether this operation has been canceled. (Inherited from OperationBase.) | |
IsComplete | Gets a value that indicates whether this operation has completed. (Inherited from OperationBase.) | |
IsErrorHandled | Gets or sets a value that indicates whether the operation error has been handled. (Inherited from OperationBase.) | |
LoadBehavior | Gets the System.ServiceModel.DomainServices.Client.LoadBehavior for this load operation. (Inherited from LoadOperation.) | |
Result | Gets the DomainClientResult for this operation. (Inherited from LoadOperation.) | |
SupportsCancellation | Gets a value that indicates whether this operation supports cancellation. (Inherited from OperationBase.) | |
TotalEntityCount | Gets the total server entity count for the query used by this operation. (Inherited from LoadOperation.) | |
UserState | Gets the optional user state for this operation. (Inherited from OperationBase.) | |
ValidationErrors | Gets the validation errors. (Inherited from LoadOperation.) |
Top
Methods
Name | Description | |
---|---|---|
Cancel | Cancels the operation. (Inherited from OperationBase.) | |
CancelCore | When overridden in a derived class, provides the logic to cancel the operation. (Inherited from OperationBase.) | |
Complete(Exception) | Completes a failed operation with the specified error. (Inherited from OperationBase.) | |
Complete(Object) | Completes a successful operation with the specified result. (Inherited from OperationBase.) | |
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
InvokeCompleteAction | Invokes the completion callback. (Inherited from OperationBase.) | |
MarkErrorAsHandled | Specifies that an error encountered in an operation is handled. (Inherited from OperationBase.) | |
MemberwiseClone | (Inherited from Object.) | |
OnPropertyChanged | Called when the value of a property changes. (Inherited from OperationBase.) | |
RaisePropertyChanged | Raises the System#ComponentModel#INotifyPropertyChanged#PropertyChanged() event. (Inherited from OperationBase.) | |
ToString | (Inherited from Object.) | |
UpdateResults | Updates the observable result collections. (Inherited from LoadOperation.) |
Top
Events
Name | Description | |
---|---|---|
Completed | Occurs when the operation completes. (Inherited from OperationBase.) |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
INotifyPropertyChanged.PropertyChanged | Occurs when a property value changes. (Inherited from OperationBase.) |
Top
Examples
The following example shows a LoadOperation<TEntity> object that is used to populate a DataGrid with data from a query.
Imports System.Windows.Ria
Imports RIAServicesExample.Web
Partial Public Class MainPage
Inherits UserControl
Private _customerContext As New CustomerDomainContext
Public Sub New()
InitializeComponent()
Dim loadOp = Me._customerContext.Load(Me._customerContext.GetCustomersQuery())
CustomerGrid.ItemsSource = loadOp.Entities
End Sub
End Class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using RIAServicesExample.Web;
using System.Windows.Ria;
namespace RIAServicesExample
{
public partial class MainPage : UserControl
{
private CustomerDomainContext _customerContext = new CustomerDomainContext();
public MainPage()
{
InitializeComponent();
LoadOperation<Customer> loadOp = this._customerContext.Load(this._customerContext.GetCustomersQuery());
CustomerGrid.ItemsSource = loadOp.Entities;
}
}
}
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.