Compartilhar via


EntityExtensions.SetRelatedEntity<TEntity> Method (Entity, String, 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,
    TEntity value
)
where TEntity : Entity
public:
generic<typename TEntity>
where TEntity : Entity
[ExtensionAttribute]
static void SetRelatedEntity(
    Entity^ entity,
    String^ relationshipSchemaName,
    TEntity value
)
static member SetRelatedEntity<'TEntity when 'TEntity : Entity> : 
        entity:Entity *
        relationshipSchemaName:string *
        value:'TEntity -> unit
<ExtensionAttribute>
Public Shared Sub SetRelatedEntity(Of TEntity As Entity) (
    entity As Entity,
    relationshipSchemaName As String,
    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