Interface IAsyncOrgService
Provides programmatic access to the metadata and data for an organization.
Namespace: Hsl.Xrm.Sdk
Assembly: Hsl.Xrm.Sdk.Core.dll
Syntax
public interface IAsyncOrgService
Methods
AssociateAsync(String, Guid, Relationship, EntityReferenceCollection, CancellationToken)
Creates a link between records.
Declaration
Task AssociateAsync(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | entityName | Type: Returns_String. The logical name of the entity that is specified in the entityId parameter. |
System.Guid | entityId | Type: Returns_Guid. property_entityid to which the related records are associated. |
Microsoft.Xrm.Sdk.Relationship | relationship | Type: Microsoft.Xrm.Sdk.Relationship. The name of the relationship to be used to create the link. |
Microsoft.Xrm.Sdk.EntityReferenceCollection | relatedEntities | Type: Microsoft.Xrm.Sdk.EntityReferenceCollection. property_relatedentities to be associated. |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
CreateAsync(Entity, CancellationToken)
Creates a record.
Declaration
Task<Guid> CreateAsync(Entity entity, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xrm.Sdk.Entity | entity | Type: Microsoft.Xrm.Sdk.Entity. An entity instance that contains the properties to set in the newly created record. |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Guid> | Type:Returns_Guid The ID of the newly created record. |
DeleteAsync(String, Guid, CancellationToken)
Deletes a record.
Declaration
Task DeleteAsync(string entityName, Guid id, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | entityName | Type: Returns_String. The logical name of the entity that is specified in the entityId parameter. |
System.Guid | id | Type: Returns_Guid. The ID of the record that you want to delete. |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
DisassociateAsync(String, Guid, Relationship, EntityReferenceCollection, CancellationToken)
Deletes a link between records.
Declaration
Task DisassociateAsync(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | entityName | Type: Returns_String. The logical name of the entity that is specified in the entityId parameter. |
System.Guid | entityId | Type: Returns_Guid. The ID of the record from which the related records are disassociated. |
Microsoft.Xrm.Sdk.Relationship | relationship | Type: Microsoft.Xrm.Sdk.Relationship. The name of the relationship to be used to remove the link. |
Microsoft.Xrm.Sdk.EntityReferenceCollection | relatedEntities | Type: Microsoft.Xrm.Sdk.EntityReferenceCollection. A collection of entity references (references to records) to be disassociated. |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
ExecuteAsync(OrganizationRequest, CancellationToken)
Executes a message in the form of a request, and returns a response.
Declaration
Task<OrganizationResponse> ExecuteAsync(OrganizationRequest request, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xrm.Sdk.OrganizationRequest | request | Type: Microsoft.Xrm.Sdk.OrganizationRequest. A request instance that defines the action to be performed. |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Microsoft.Xrm.Sdk.OrganizationResponse> | Type: Microsoft.Xrm.Sdk.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.
Declaration
Task<Entity> RetrieveAsync(string entityName, Guid id, ColumnSet columnSet, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | entityName | Type: Returns_String. The logical name of the entity that is specified in the entityId parameter. |
System.Guid | id | Type: Returns_Guid. The ID of the record that you want to retrieve. |
Microsoft.Xrm.Sdk.Query.ColumnSet | columnSet | Type: Microsoft.Xrm.Sdk.Query.ColumnSet. A query that specifies the set of columns, or attributes, to retrieve. |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Microsoft.Xrm.Sdk.Entity> | Type: Microsoft.Xrm.Sdk.Entity The requested entity. |
RetrieveMultipleAsync(QueryBase, CancellationToken)
Retrieves a collection of records.
Declaration
Task<EntityCollection> RetrieveMultipleAsync(QueryBase query, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xrm.Sdk.Query.QueryBase | query | Type: Microsoft.Xrm.Sdk.Query.QueryBase. A query that determines the set of records to retrieve. |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Microsoft.Xrm.Sdk.EntityCollection> | Type: Microsoft.Xrm.Sdk.EntityCollectionThe collection of entities returned from the query. |
UpdateAsync(Entity, CancellationToken)
Updates an existing record.
Declaration
Task UpdateAsync(Entity entity, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xrm.Sdk.Entity | entity | Type: Microsoft.Xrm.Sdk.Entity. An entity instance that has one or more properties set to be updated in the record. |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |