Share via


MediaDataServiceContext.AddLink Method

Adds the specified link to the set of objects the System.Data.Services.Client.DataServiceContext is tracking.

Namespace:  Microsoft.WindowsAzure.MediaServices.Client
Assembly:  Microsoft.WindowsAzure.MediaServices.Client (in Microsoft.WindowsAzure.MediaServices.Client.dll)

Syntax

'Declaration
Public Sub AddLink ( _
    source As Object, _
    sourceProperty As String, _
    target As Object _
)
'Usage
Dim instance As MediaDataServiceContext 
Dim source As Object 
Dim sourceProperty As String 
Dim target As Object

instance.AddLink(source, sourceProperty, _
    target)
public void AddLink(
    Object source,
    string sourceProperty,
    Object target
)
public:
virtual void AddLink(
    Object^ source, 
    String^ sourceProperty, 
    Object^ target
) sealed
abstract AddLink : 
        source:Object * 
        sourceProperty:string * 
        target:Object -> unit  
override AddLink : 
        source:Object * 
        sourceProperty:string * 
        target:Object -> unit
public final function AddLink(
    source : Object, 
    sourceProperty : String, 
    target : Object
)

Parameters

  • sourceProperty
    Type: System.String
    The name of the navigation property on the source object that returns the related object.
  • target
    Type: System.Object
    The object related to the source object by the new link.

Implements

IMediaDataServiceContext.AddLink(Object, String, Object)

Remarks

Notifies the context that a new link exists between the source and target objects and that the link is represented via the source.sourceProperty which is a collection. The context adds this link to the set of newly created links to be sent to the data service on the next call to SaveChanges(). Links are one way relationships. If a back pointer exists (ie. two way association), this method should be called a second time to notify the context object of the second link.

See Also

Reference

MediaDataServiceContext Class

Microsoft.WindowsAzure.MediaServices.Client Namespace