EntityExtensions.GetRelatedEntities<TEntity> Method (Entity, String, Nullable<EntityRole>)
Applies To: Dynamics CRM 2013
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<TEntity> GetRelatedEntities<TEntity>(
this Entity entity,
string relationshipSchemaName,
Nullable<EntityRole> primaryEntityRole = null
)
where TEntity : Entity
public:
generic<typename TEntity>
where TEntity : Entity
[ExtensionAttribute]
static IEnumerable<TEntity>^ GetRelatedEntities(
Entity^ entity,
String^ relationshipSchemaName,
Nullable<EntityRole> primaryEntityRole = null
)
static member GetRelatedEntities<'TEntity when 'TEntity : Entity> :
entity:Entity *
relationshipSchemaName:string *
primaryEntityRole:Nullable<EntityRole> = null -> IEnumerable<'TEntity>
<ExtensionAttribute>
Public Shared Function GetRelatedEntities(Of TEntity As Entity) (
entity As Entity,
relationshipSchemaName As String,
primaryEntityRole As Nullable(Of EntityRole)
) As IEnumerable(Of TEntity)
Parameters
entity
Type: Microsoft.Xrm.Sdk.EntityType: Entity. The entity instance.
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<TEntity>
Type: IEnumerable<Entity>
The collection of related entities for the relationship.
Type Parameters
- TEntity
The type, where TEntity is an Entity.
Remarks
Extends the core GetRelatedEntities<TEntity> method.
See Also
GetRelatedEntities Overload
EntityExtensions Class
Microsoft.Xrm.Client Namespace
Return to top