LoadOperation 泛型类

表示一个异步加载操作。

命名空间: System.ServiceModel.DomainServices.Client
程序集: System.ServiceModel.DomainServices.Client(在 system.servicemodel.domainservices.client.dll 中)

用法

用法
Dim instance As LoadOperation(Of TEntity)

语法

声明
Public NotInheritable Class LoadOperation(Of TEntity As Entity)
    Inherits LoadOperation
public sealed class LoadOperation<TEntity> : LoadOperation where TEntity : Entity
generic<typename TEntity> where TEntity : Entity
public ref class LoadOperation sealed : public LoadOperation

GenericParameters

  • TEntity
    正在加载的实体类型。

示例

下面的示例演示了 LoadOperation 对象如何利用来自查询的数据填充 DataGrid

Imports System.ServiceModel.DomainServices.Client
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.ServiceModel.DomainServices.Client;

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;
        }
    }
}

继承层次结构

System.Object
   System.ServiceModel.DomainServices.Client.OperationBase
     System.ServiceModel.DomainServices.Client.LoadOperation
      System.ServiceModel.DomainServices.Client.LoadOperation

线程安全

此类型的任何公共静态(在 Visual Basic 中为 共享)成员都是线程安全的。不保证所有实例成员都是线程安全的。

平台

开发平台

Windows XP Home Edition, Windows XP Professional, Windows Server 2003 、Windows Server 2008 和 Windows 2000

目标平台

Change History

另请参见

参考

LoadOperation 成员
System.ServiceModel.DomainServices.Client 命名空间