Entity.SetRelatedEntity<TEntity> Method (String, Nullable<EntityRole>, TEntity)
Applies To: Dynamics CRM 2015
Sets the related entity instance for the specified relationship.
Namespace: Microsoft.Xrm.Sdk
Assembly: Microsoft.Xrm.Sdk (in Microsoft.Xrm.Sdk.dll)
Syntax
protected virtual void SetRelatedEntity<TEntity>(
string relationshipSchemaName,
Nullable<EntityRole> primaryEntityRole,
TEntity entity
)
where TEntity : Entity
protected:
generic<typename TEntity>
where TEntity : Entity
virtual void SetRelatedEntity(
String^ relationshipSchemaName,
Nullable<EntityRole> primaryEntityRole,
TEntity entity
)
abstract SetRelatedEntity<'TEntity when 'TEntity : Entity> :
relationshipSchemaName:string *
primaryEntityRole:Nullable<EntityRole> *
entity:'TEntity -> unit
override SetRelatedEntity<'TEntity when 'TEntity : Entity> :
relationshipSchemaName:string *
primaryEntityRole:Nullable<EntityRole> *
entity:'TEntity -> unit
Protected Overridable Sub SetRelatedEntity(Of TEntity As Entity) (
relationshipSchemaName As String,
primaryEntityRole As Nullable(Of EntityRole),
entity As TEntity
)
Parameters
relationshipSchemaName
Type: System.StringType: String. The schema name of the relationship.
primaryEntityRole
Type: System.Nullable<EntityRole>Type: EntityRole. The role of the primary entity in the relationship (referenced or referencing).
entity
Type: TEntityType: Entity. The entity instance to set.
Type Parameters
- TEntity
Type: Entity. The type of the entity.
Examples
SetRelatedEntity<mbs_project>("mbs_project_workiem", null, value);
See Also
Entity Class
Microsoft.Xrm.Sdk Namespace
Return to top
© 2016 Microsoft. All rights reserved. Copyright