Share via


DataServiceContext.AttachLink(Object, String, Object) Method

Definition

Notifies the DataServiceContext to start tracking the specified link that defines a relationship between entity objects.

public virtual void AttachLink (object source, string sourceProperty, object target);
abstract member AttachLink : obj * string * obj -> unit
override this.AttachLink : obj * string * obj -> unit
Public Overridable Sub AttachLink (source As Object, sourceProperty As String, target As Object)

Parameters

source
Object

The source object in the new link.

sourceProperty
String

The name of the property on the source object that represents the link between the source and target object.

target
Object

The target object in the link that is bound to the source object specified in this call. The target object must be of the type identified by the source property or a subtype.

Exceptions

When source, sourceProperty, or target is null.

When the link between the two entities already exists.-or-When source or target is in an Added or Deleted state.

Applies to