EntityExtensions.GetRelatedEntities Method (Entity, OrganizationServiceContext, String, Nullable<EntityRole>)
Applies To: Dynamics CRM 2015
Retrieves the collection of related entities for a specific relationship.
Namespace: Microsoft.Xrm.Client
Assembly: Microsoft.Xrm.Client (in Microsoft.Xrm.Client.dll)
Syntax
public static IEnumerable<Entity> GetRelatedEntities(
this Entity entity,
OrganizationServiceContext context,
string relationshipSchemaName,
Nullable<EntityRole> primaryEntityRole = null
)
public:
[ExtensionAttribute]
static IEnumerable<Entity^>^ GetRelatedEntities(
Entity^ entity,
OrganizationServiceContext^ context,
String^ relationshipSchemaName,
Nullable<EntityRole> primaryEntityRole = null
)
static member GetRelatedEntities :
entity:Entity *
context:OrganizationServiceContext *
relationshipSchemaName:string *
primaryEntityRole:Nullable<EntityRole> = null -> IEnumerable<Entity>
<ExtensionAttribute>
Public Shared Function GetRelatedEntities (
entity As Entity,
context As OrganizationServiceContext,
relationshipSchemaName As String,
primaryEntityRole As Nullable(Of EntityRole)
) As IEnumerable(Of Entity)
Parameters
entity
Type: Microsoft.Xrm.Sdk.EntityType: Entity. The entity instance.
context
Type: Microsoft.Xrm.Sdk.Client.OrganizationServiceContextType: OrganizationServiceContext. The service context.
relationshipSchemaName
Type: System.StringType: String. The schema name of the relationship.
primaryEntityRole
Type: System.Nullable<EntityRole>Type: Nullable<EntityRole>. The role that the entity plays in the relationship, referencing or referenced.
Return Value
Type: System.Collections.Generic.IEnumerable<Entity>
Type: IEnumerable<Entity>
The collection of related entities for the relationship.
Remarks
Extends the core GetRelatedEntities<TEntity> method.
See Also
GetRelatedEntities Overload
EntityExtensions Class
Microsoft.Xrm.Client Namespace
Return to top
© 2017 Microsoft. All rights reserved. Copyright