Interface IAsyncOrgService
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
stringType: Returns_String. The logical name of the entity that is specified in the entityId parameter.
entityId
GuidType: Returns_Guid. property_entityid to which the related records are associated.
relationship
RelationshipType: Relationship. The name of the relationship to be used to create the link.
relatedEntities
EntityReferenceCollectionType: EntityReferenceCollection. property_relatedentities to be associated.
cancellationToken
CancellationToken
Returns
CreateAsync(Entity, CancellationToken)
Creates a record.
Task<Guid> CreateAsync(Entity entity, CancellationToken cancellationToken = default)
Parameters
entity
EntityType: Entity. An entity instance that contains the properties to set in the newly created record.
cancellationToken
CancellationToken
Returns
DeleteAsync(string, Guid, CancellationToken)
Deletes a record.
Task DeleteAsync(string entityName, Guid id, CancellationToken cancellationToken = default)
Parameters
entityName
stringType: Returns_String. The logical name of the entity that is specified in the entityId parameter.
id
GuidType: Returns_Guid. The ID of the record that you want to delete.
cancellationToken
CancellationToken
Returns
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
stringType: Returns_String. The logical name of the entity that is specified in the entityId parameter.
entityId
GuidType: Returns_Guid. The ID of the record from which the related records are disassociated.
relationship
RelationshipType: Relationship. The name of the relationship to be used to remove the link.
relatedEntities
EntityReferenceCollectionType: EntityReferenceCollection. A collection of entity references (references to records) to be disassociated.
cancellationToken
CancellationToken
Returns
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
OrganizationRequestType: 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
stringType: Returns_String. The logical name of the entity that is specified in the entityId parameter.
id
GuidType: Returns_Guid. The ID of the record that you want to retrieve.
columnSet
ColumnSetType: ColumnSet. A query that specifies the set of columns, or attributes, to retrieve.
cancellationToken
CancellationToken
Returns
RetrieveMultipleAsync(QueryBase, CancellationToken)
Retrieves a collection of records.
Task<EntityCollection> RetrieveMultipleAsync(QueryBase query, CancellationToken cancellationToken = default)
Parameters
query
QueryBaseType: 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
EntityType: Entity. An entity instance that has one or more properties set to be updated in the record.
cancellationToken
CancellationToken