DataServiceContext.BeginLoadProperty 方法 (Object, String, AsyncCallback, Object)
从数据服务异步加载指定属性的值。
命名空间: System.Data.Services.Client
程序集: Microsoft.Data.Services.Client(在 Microsoft.Data.Services.Client.dll 中)
语法
声明
Public Function BeginLoadProperty ( _
entity As Object, _
propertyName As String, _
callback As AsyncCallback, _
state As Object _
) As IAsyncResult
用法
Dim instance As DataServiceContext
Dim entity As Object
Dim propertyName As String
Dim callback As AsyncCallback
Dim state As Object
Dim returnValue As IAsyncResult
returnValue = instance.BeginLoadProperty(entity, _
propertyName, callback, state)
public IAsyncResult BeginLoadProperty(
Object entity,
string propertyName,
AsyncCallback callback,
Object state
)
public:
IAsyncResult^ BeginLoadProperty(
Object^ entity,
String^ propertyName,
AsyncCallback^ callback,
Object^ state
)
member BeginLoadProperty :
entity:Object *
propertyName:string *
callback:AsyncCallback *
state:Object -> IAsyncResult
public function BeginLoadProperty(
entity : Object,
propertyName : String,
callback : AsyncCallback,
state : Object
) : IAsyncResult
参数
- entity
类型:System.Object
包含要加载的属性的实体。
- propertyName
类型:System.String
要加载的指定实体上的属性名称。
- callback
类型:System.AsyncCallback
收到请求响应时所调用的委托。
- state
类型:System.Object
用户定义的状态对象,用于将上下文数据传递给回调方法。
返回值
类型:System.IAsyncResult
表示异步操作状态的 IAsyncResult。
注释
调用此方法时,将调用网络操作来检索属性的值。 指定的属性可以是实体的任一属性,包括表示关联或链接的属性。 如果属性是表示关联、链接或延迟的属性,则调用此方法时,会向客户端提供延迟加载相关资源的方式。 如果实体处于已修改状态,则属性值将加载相关实体,并将这些实体及任何链接标记为“未更改”。
如果已加载属性,则调用此方法可让您刷新该属性的值。