Dela via


Entity.GetRelatedEntities<TEntity> Method (String, Nullable<EntityRole>)

 

Applies To: Dynamics CRM 2015

Gets the collection of related entity instances for the specified relationship.

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

Syntax

protected virtual IEnumerable<TEntity> GetRelatedEntities<TEntity>(
    string relationshipSchemaName,
    Nullable<EntityRole> primaryEntityRole
)
where TEntity : Entity
protected:
generic<typename TEntity>
where TEntity : Entity
virtual IEnumerable<TEntity>^ GetRelatedEntities(
    String^ relationshipSchemaName,
    Nullable<EntityRole> primaryEntityRole
)
abstract GetRelatedEntities<'TEntity when 'TEntity : Entity> : 
        relationshipSchemaName:string *
        primaryEntityRole:Nullable<EntityRole> -> IEnumerable<'TEntity>
override GetRelatedEntities<'TEntity when 'TEntity : Entity> : 
        relationshipSchemaName:string *
        primaryEntityRole:Nullable<EntityRole> -> IEnumerable<'TEntity>
Protected Overridable Function GetRelatedEntities(Of TEntity As Entity) (
    relationshipSchemaName As String,
    primaryEntityRole As Nullable(Of EntityRole)
) As IEnumerable(Of TEntity)

Parameters

  • relationshipSchemaName
    Type: System.String

    Type: String. The schema name of the relationship.

  • primaryEntityRole
    Type: System.Nullable<EntityRole>

    The role of the primary entity in the relationship (referenced or referencing).

Return Value

Type: System.Collections.Generic.IEnumerable<TEntity>

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

Type Parameters

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

Examples

GetRelatedEntities<CampaignResponse>("activity_pointer_campaignresponse", null);

See Also

Entity Class
Microsoft.Xrm.Sdk Namespace

Return to top

© 2016 Microsoft. All rights reserved. Copyright