Share via


DataServiceContext.BeginExecute<TElement> 方法 (Uri, AsyncCallback, Object)

异步发送请求,因此在等待服务返回的结果时,此调用不会阻止处理。

命名空间:  System.Data.Services.Client
程序集:  Microsoft.Data.Services.Client(在 Microsoft.Data.Services.Client.dll 中)

语法

声明
Public Function BeginExecute(Of TElement) ( _
    requestUri As Uri, _
    callback As AsyncCallback, _
    state As Object _
) As IAsyncResult
用法
Dim instance As DataServiceContext
Dim requestUri As Uri
Dim callback As AsyncCallback
Dim state As Object
Dim returnValue As IAsyncResult

returnValue = instance.BeginExecute(requestUri, _
    callback, state)
public IAsyncResult BeginExecute<TElement>(
    Uri requestUri,
    AsyncCallback callback,
    Object state
)
public:
generic<typename TElement>
IAsyncResult^ BeginExecute(
    Uri^ requestUri, 
    AsyncCallback^ callback, 
    Object^ state
)
member BeginExecute : 
        requestUri:Uri * 
        callback:AsyncCallback * 
        state:Object -> IAsyncResult 
JScript 不支持一般类型和方法。

类型参数

  • TElement
    查询所返回的类型。

参数

  • requestUri
    类型:System.Uri
    查询请求将发送到的 URI。该 URI 可以是任何有效的数据服务 URI;它可以包含 $ 查询参数。
  • state
    类型:System.Object
    已传递到回调的用户定义的状态对象。

返回值

类型:System.IAsyncResult
用于跟踪异步操作状态的对象。

注释

返回的 IAsyncResult 对象可用于确定异步操作何时已完成。 有关详细信息,请参阅异步操作(WCF 数据服务)

BeginExecute 方法使用与 Execute 方法相同的语义,但此方法异步发送请求,因此此调用在等待服务返回的结果时不会阻止处理。 根据标准的 begin-end 异步模式,在检索查询结果时将调用所提供的回调。

请参阅

参考

DataServiceContext 类

BeginExecute 重载

System.Data.Services.Client 命名空间

其他资源

如何:执行异步数据服务查询(WCF 数据服务)