RelationshipManager.InitializeRelatedCollection<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í EntityCollection, 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 určena k použití pouze během deserializace a vyvolá výjimku v případě, že entityCollection již byla inicializována, nebo pokud je již připojen správce relací ObjectContext.
[System.ComponentModel.Browsable(false)]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public void InitializeRelatedCollection<TTargetEntity> (string relationshipName, string targetRoleName, System.Data.Entity.Core.Objects.DataClasses.EntityCollection<TTargetEntity> entityCollection) where TTargetEntity : class;
member this.InitializeRelatedCollection : string * string * System.Data.Entity.Core.Objects.DataClasses.EntityCollection<'argetEntity (requires 'argetEntity : null)> -> unit (requires 'argetEntity : null)
Public Sub InitializeRelatedCollection(Of TTargetEntity As Class) (relationshipName As String, targetRoleName As String, entityCollection As EntityCollection(Of TTargetEntity))
Parametry typu
- TTargetEntity
Typ entity reprezentované targetRoleName
Parametry
- relationshipName
- String
Název relace.
- targetRoleName
- String
Název cílové role.
- entityCollection
- EntityCollection<TTargetEntity>
Existující EntityCollection.
- Atributy
Platí pro
Entity Framework