Partilhar via


Método Entity.GetRelatedEntity

Aplica-se a: CRM 2015 on-prem, CRM Online

Gets the related entity instance for the specified relationship.

Namespace: Microsoft.Xrm.Sdk
Assembly: Microsoft.Xrm.Sdk (em Microsoft.Xrm.Sdk.dll)

Sintaxe

'Declaração
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.

Parâmetros

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

Valor de Retorno

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

Exemplo

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

Segurança do Thread

Todos os membros estáticos (Shared in Visual Basic) desse tipo são protegidos por thread. Não há nenhum garantia de que os membros de instância sejam protegidos por thread.

Plataformas

Plataformas de desenvolvimento

Windows Vista, Windows Server 2003 e

Plataformas de destino

Windows Vista,Windows XP

Change History

Consulte também

Referência

Classe Entity
Membros de Entity
Namespace Microsoft.Xrm.Sdk

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