EntityExtensions.SetRelatedEntity<TEntity> Method (Entity, String, Nullable<EntityRole>, TEntity)
Applies To: Dynamics CRM 2015
Modifies a related entity for a specific relationship.
Namespace: Microsoft.Xrm.Client
Assembly: Microsoft.Xrm.Client (in Microsoft.Xrm.Client.dll)
Syntax
public static void SetRelatedEntity<TEntity>(
this Entity entity,
string relationshipSchemaName,
Nullable<EntityRole> primaryEntityRole,
TEntity value
)
where TEntity : Entity
public:
generic<typename TEntity>
where TEntity : Entity
[ExtensionAttribute]
static void SetRelatedEntity(
Entity^ entity,
String^ relationshipSchemaName,
Nullable<EntityRole> primaryEntityRole,
TEntity value
)
static member SetRelatedEntity<'TEntity when 'TEntity : Entity> :
entity:Entity *
relationshipSchemaName:string *
primaryEntityRole:Nullable<EntityRole> *
value:'TEntity -> unit
<ExtensionAttribute>
Public Shared Sub SetRelatedEntity(Of TEntity As Entity) (
entity As Entity,
relationshipSchemaName As String,
primaryEntityRole As Nullable(Of EntityRole),
value As 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
value
Type: TEntityType: TEntity, where TEntity is an Entity. The entity instance to be related.
Type Parameters
- TEntity
The type, where TEntity is an Entity.
Remarks
Extends the core SetRelatedEntity<TEntity> method.
See Also
SetRelatedEntity Overload
EntityExtensions Class
Microsoft.Xrm.Client Namespace
Return to top
© 2017 Microsoft. All rights reserved. Copyright