RelationshipManager.InitializeRelatedReference<TTargetEntity> Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Vezme existující EntityReference, který byl vytvořen pomocí výchozího konstruktoru, a inicializuje ho pomocí zadaných názvů relací a cílových rolí. Tato metoda je navržená tak, aby se používala pouze během deserializace, a pokud již byla inicializována poskytnutá entita EntityReference, pokud správce relací již obsahuje relaci s tímto názvem a cílovou rolí nebo pokud je správce relací již připojen k ObjektContext.W
[System.ComponentModel.Browsable(false)]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public void InitializeRelatedReference<TTargetEntity>(string relationshipName, string targetRoleName, System.Data.Entity.Core.Objects.DataClasses.EntityReference<TTargetEntity> entityReference) where TTargetEntity : class;
member this.InitializeRelatedReference : string * string * System.Data.Entity.Core.Objects.DataClasses.EntityReference<'argetEntity (requires 'argetEntity : null)> -> unit (requires 'argetEntity : null)
Public Sub InitializeRelatedReference(Of TTargetEntity As Class) (relationshipName As String, targetRoleName As String, entityReference As EntityReference(Of TTargetEntity))
Parametry typu
- TTargetEntity
Typ EntityReference<TEntity> inicializace.
Parametry
- relationshipName
- String
Název relace.
- targetRoleName
- String
Název role souvisejícího konce.
- entityReference
- EntityReference<TTargetEntity>
Inicializace EntityReference<TEntity> .
- Atributy
Výjimky
Pokud je zadaný již EntityReference<TEntity> inicializován.-or-Když správce vztahů je již připojen k nebo ObjectContext pokud správce relací již obsahuje relaci s tímto názvem a cílovou rolí.