DataServiceContext.AddRelatedObject(Object, String, Object) Metodo

Definizione

Aggiunge un oggetto correlato al contesto e crea il collegamento che definisce la relazione tra i due oggetti in una singola richiesta.

public:
 void AddRelatedObject(System::Object ^ source, System::String ^ sourceProperty, System::Object ^ target);
public void AddRelatedObject (object source, string sourceProperty, object target);
member this.AddRelatedObject : obj * string * obj -> unit
Public Sub AddRelatedObject (source As Object, sourceProperty As String, target As Object)

Parametri

source
Object

Oggetto padre rilevato dal contesto.

sourceProperty
String

Nome della proprietà di navigazione che restituisce l'oggetto correlato in base a un'associazione tra le due entità.

target
Object

Oggetto correlato aggiunto.

Commenti

È possibile chiamare il metodo AddRelatedObject per aggiungere un oggetto correlato anziché chiamare questi tre metodi: AddObject, AddLink, SetLink.

Si applica a