Entity.SetRelatedEntities<TEntity> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the collection of related entity instances for the specified relationship.
protected:
generic <typename TEntity>
where TEntity : Microsoft::Xrm::Sdk::Entity virtual void SetRelatedEntities(System::String ^ relationshipSchemaName, Nullable<Microsoft::Xrm::Sdk::EntityRole> primaryEntityRole, System::Collections::Generic::IEnumerable<TEntity> ^ entities);
protected virtual void SetRelatedEntities<TEntity> (string relationshipSchemaName, Microsoft.Xrm.Sdk.EntityRole? primaryEntityRole, System.Collections.Generic.IEnumerable<TEntity> entities) where TEntity : Microsoft.Xrm.Sdk.Entity;
abstract member SetRelatedEntities : string * Nullable<Microsoft.Xrm.Sdk.EntityRole> * seq<'Entity (requires 'Entity :> Microsoft.Xrm.Sdk.Entity)> -> unit (requires 'Entity :> Microsoft.Xrm.Sdk.Entity)
override this.SetRelatedEntities : string * Nullable<Microsoft.Xrm.Sdk.EntityRole> * seq<'Entity (requires 'Entity :> Microsoft.Xrm.Sdk.Entity)> -> unit (requires 'Entity :> Microsoft.Xrm.Sdk.Entity)
Protected Overridable Sub SetRelatedEntities(Of TEntity As Entity) (relationshipSchemaName As String, primaryEntityRole As Nullable(Of EntityRole), entities As IEnumerable(Of TEntity))
Type Parameters
- TEntity
The type of the entity.
Parameters
- relationshipSchemaName
- String
The schema name of the relationship.
- primaryEntityRole
- Nullable<EntityRole>
The role of the primary entity in the relationship (referenced or referencing).
- entities
- IEnumerable<TEntity>
The collection of entity instances to set.
Examples
SetRelatedEntities<ActivityPointer>("Account_ActivityPointers", null, value);