Adds the specified link to the set of objects the DataServiceContext is tracking.
Assembly: System.Data.Services.Client (in System.Data.Services.Client.dll)
Notifies the DataServiceContext that a new link exists between the related source and target objects and that the link is represented by the specified source property. The DataServiceContext adds this link to the set of newly created links that will be sent to the data service on the next call to SaveChanges. For more information, see Updating the Data Service (WCF Data Services).
The target object must be of the type identified by the sourceProperty parameter or a subtype of the type.
The following example shows how to use the and SetLink methods to create links that define relationships. In this example, the navigation properties on the Order_Details object are also explicitly set. 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.
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.