Table of Contents

Interface IAsyncOrgService

Namespace
Hsl.Xrm.Sdk
Assembly
Hsl.Xrm.Sdk.Core.dll

Provides programmatic access to the metadata and data for an organization.

public interface IAsyncOrgService
Extension Methods

Methods

AssociateAsync(string, Guid, Relationship, EntityReferenceCollection, CancellationToken)

Creates a link between records.

Task AssociateAsync(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities, CancellationToken cancellationToken = default)

Parameters

entityName string

Type: Returns_String. The logical name of the entity that is specified in the entityId parameter.

entityId Guid

Type: Returns_Guid. property_entityid to which the related records are associated.

relationship Relationship

Type: Relationship. The name of the relationship to be used to create the link.

relatedEntities EntityReferenceCollection

Type: EntityReferenceCollection. property_relatedentities to be associated.

cancellationToken CancellationToken

Returns

Task

CreateAsync(Entity, CancellationToken)

Creates a record.

Task<Guid> CreateAsync(Entity entity, CancellationToken cancellationToken = default)

Parameters

entity Entity

Type: Entity. An entity instance that contains the properties to set in the newly created record.

cancellationToken CancellationToken

Returns

Task<Guid>

Type:Returns_Guid The ID of the newly created record.

DeleteAsync(string, Guid, CancellationToken)

Deletes a record.

Task DeleteAsync(string entityName, Guid id, CancellationToken cancellationToken = default)

Parameters

entityName string

Type: Returns_String. The logical name of the entity that is specified in the entityId parameter.

id Guid

Type: Returns_Guid. The ID of the record that you want to delete.

cancellationToken CancellationToken

Returns

Task

DisassociateAsync(string, Guid, Relationship, EntityReferenceCollection, CancellationToken)

Deletes a link between records.

Task DisassociateAsync(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities, CancellationToken cancellationToken = default)

Parameters

entityName string

Type: Returns_String. The logical name of the entity that is specified in the entityId parameter.

entityId Guid

Type: Returns_Guid. The ID of the record from which the related records are disassociated.

relationship Relationship

Type: Relationship. The name of the relationship to be used to remove the link.

relatedEntities EntityReferenceCollection

Type: EntityReferenceCollection. A collection of entity references (references to records) to be disassociated.

cancellationToken CancellationToken

Returns

Task

ExecuteAsync(OrganizationRequest, CancellationToken)

Executes a message in the form of a request, and returns a response.

Task<OrganizationResponse> ExecuteAsync(OrganizationRequest request, CancellationToken cancellationToken = default)

Parameters

request OrganizationRequest

Type: OrganizationRequest. A request instance that defines the action to be performed.

cancellationToken CancellationToken

Returns

Task<OrganizationResponse>

Type: OrganizationResponseThe response from the request. You must cast the return value of this method to the specific instance of the response that corresponds to the Request parameter.

RetrieveAsync(string, Guid, ColumnSet, CancellationToken)

Retrieves a record.

Task<Entity> RetrieveAsync(string entityName, Guid id, ColumnSet columnSet, CancellationToken cancellationToken = default)

Parameters

entityName string

Type: Returns_String. The logical name of the entity that is specified in the entityId parameter.

id Guid

Type: Returns_Guid. The ID of the record that you want to retrieve.

columnSet ColumnSet

Type: ColumnSet. A query that specifies the set of columns, or attributes, to retrieve.

cancellationToken CancellationToken

Returns

Task<Entity>

Type: Entity The requested entity.

RetrieveMultipleAsync(QueryBase, CancellationToken)

Retrieves a collection of records.

Task<EntityCollection> RetrieveMultipleAsync(QueryBase query, CancellationToken cancellationToken = default)

Parameters

query QueryBase

Type: QueryBase. A query that determines the set of records to retrieve.

cancellationToken CancellationToken

Returns

Task<EntityCollection>

Type: EntityCollectionThe collection of entities returned from the query.

UpdateAsync(Entity, CancellationToken)

Updates an existing record.

Task UpdateAsync(Entity entity, CancellationToken cancellationToken = default)

Parameters

entity Entity

Type: Entity. An entity instance that has one or more properties set to be updated in the record.

cancellationToken CancellationToken

Returns

Task