Compartir a través de


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

 

Applies To: Dynamics CRM 2013

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

  • relationshipSchemaName
    Type: System.String

    Type: String. The schema name of the relationship.

  • value
    Type: TEntity

    Type: 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