Del via


Entity.GetRelatedEntity-metode

Gets the related entity instance for the specified relationship.

Navneområde: Microsoft.Xrm.Sdk
Assembly: Microsoft.Xrm.Sdk (i Microsoft.Xrm.Sdk.dll)

Syntaks

'Deklaration
Protected Overridable Function GetRelatedEntity(Of TEntity As Entity) ( _
    relationshipSchemaName As String, _
    primaryEntityRole As Nullable(Of EntityRole) _
) As TEntity
protected virtual TEntity GetRelatedEntity<TEntity> (
    string relationshipSchemaName,
    Nullable<EntityRole> primaryEntityRole
) where TEntity : Entity

GenericParameters

  • TEntity
    Type: Entity. The type of the entity.

Parametre

  • relationshipSchemaName
    Type: Streng. The name of the relationship.
  • primaryEntityRole
    Type: EntityRole. The role of the primary entity in the relationship (referenced or referencing).

Returværdi

Type: Entity
The collection of related entity instances for the specified relationship.

Eksempel

GetRelatedEntity<Account>("account_primary_contact", null);

Sikkerhed i tråd

Alle offentlige statiske (Shared i Visual Basic) medlemmer af denne type er trådsikret. Alle medlemmer af forekomsten er ikke garanteret trådsikkerhed.

Platforme

Development Platforms

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

Target Platforms

Windows Server 2008,Windows Server 2012,Windows 7

Change History

Se også

Reference

Entity-klasse
Entity-medlemmer
Microsoft.Xrm.Sdk-navneområde

Send comments about this topic to Microsoft.
© 2015 Microsoft. All rights reserved.