다음을 통해 공유


CrmEntity.SetRelatedEntity<TEntity> Method (String, String, Nullable<EntityRole>, TEntity)

 

Applies To: Dynamics CRM 2013

Sets the related entity for a specific relationship.

Namespace:   Microsoft.Xrm.Client
Assembly:  Microsoft.Xrm.Client (in Microsoft.Xrm.Client.dll)

Syntax

protected virtual void SetRelatedEntity<TEntity>(
    string propertyName,
    string relationshipSchemaName,
    Nullable<EntityRole> primaryEntityRole,
    TEntity entity
)
where TEntity : Entity
protected:
generic<typename TEntity>
where TEntity : Entity
virtual void SetRelatedEntity(
    String^ propertyName,
    String^ relationshipSchemaName,
    Nullable<EntityRole> primaryEntityRole,
    TEntity entity
)
abstract SetRelatedEntity<'TEntity when 'TEntity : Entity> : 
        propertyName:string *
        relationshipSchemaName:string *
        primaryEntityRole:Nullable<EntityRole> *
        entity:'TEntity -> unit
override SetRelatedEntity<'TEntity when 'TEntity : Entity> : 
        propertyName:string *
        relationshipSchemaName:string *
        primaryEntityRole:Nullable<EntityRole> *
        entity:'TEntity -> unit
Protected Overridable Sub SetRelatedEntity(Of TEntity As Entity) (
    propertyName As String,
    relationshipSchemaName As String,
    primaryEntityRole As Nullable(Of EntityRole),
    entity As TEntity
)

Parameters

  • relationshipSchemaName
    Type: System.String

    Type: String. The schema name of the relationship.

  • entity
    Type: TEntity

    Type: IEnumerable<TEntity>. The entity to be related.

Type Parameters

  • TEntity
    Type: Entity. The entity to which the entity is to be related.

Remarks

Extends the core SetRelatedEntity<TEntity> method.

See Also

SetRelatedEntity Overload
CrmEntity Class
Microsoft.Xrm.Client Namespace

Return to top