This documentation is archived and is not being maintained.

DataServiceContext::LoadProperty Method (Object, String)

Loads deferred content for a specified property from the data service.

Namespace:  System.Data.Services.Client
Assembly:  System.Data.Services.Client (in System.Data.Services.Client.dll)

QueryOperationResponse^ LoadProperty(
	Object^ entity, 
	String^ propertyName


Type: System::Object
The entity that contains the property to load.
Type: System::String
The name of the property of the specified entity to load.

Return Value

Type: System.Data.Services.Client::QueryOperationResponse
The response to the load operation.

Calling this method invokes a network operation to fetch the property value. The property specified may be any one of the properties on the entity, including properties that represent associations or links.

If the property represents an association, link or deferred property, calling this method provides the client a way to lazily load related resources.

If the entity is in the unchanged or modified state, the property value loads the related entities and marks them unchanged with unchanged links

If the property is already loaded, calling this method lets you refresh the value of the property.

The following example shows how to explicitly load the Customers object that is related to each returned Orders instance. This example uses the DataServiceContext generated by the Add Service Reference tool based on the Northwind data service, which is created when you complete the WCF Data Services quickstart.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5 SP1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.