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
entityNamestringType: Returns_String. The logical name of the entity that is specified in the entityId parameter.
entityIdGuidType: Returns_Guid. property_entityid to which the related records are associated.
relationshipRelationshipType: Relationship. The name of the relationship to be used to create the link.
relatedEntitiesEntityReferenceCollectionType: EntityReferenceCollection. property_relatedentities to be associated.
cancellationTokenCancellationToken
Returns
CreateAsync(Entity, CancellationToken)
Creates a record.
Task<Guid> CreateAsync(Entity entity, CancellationToken cancellationToken = default)
Parameters
entityEntityType: Entity. An entity instance that contains the properties to set in the newly created record.
cancellationTokenCancellationToken
Returns
DeleteAsync(string, Guid, CancellationToken)
Deletes a record.
Task DeleteAsync(string entityName, Guid id, CancellationToken cancellationToken = default)
Parameters
entityNamestringType: Returns_String. The logical name of the entity that is specified in the entityId parameter.
idGuidType: Returns_Guid. The ID of the record that you want to delete.
cancellationTokenCancellationToken
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
entityNamestringType: Returns_String. The logical name of the entity that is specified in the entityId parameter.
entityIdGuidType: Returns_Guid. The ID of the record from which the related records are disassociated.
relationshipRelationshipType: Relationship. The name of the relationship to be used to remove the link.
relatedEntitiesEntityReferenceCollectionType: EntityReferenceCollection. A collection of entity references (references to records) to be disassociated.
cancellationTokenCancellationToken
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
requestOrganizationRequestType: OrganizationRequest. A request instance that defines the action to be performed.
cancellationTokenCancellationToken
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
entityNamestringType: Returns_String. The logical name of the entity that is specified in the entityId parameter.
idGuidType: Returns_Guid. The ID of the record that you want to retrieve.
columnSetColumnSetType: ColumnSet. A query that specifies the set of columns, or attributes, to retrieve.
cancellationTokenCancellationToken
Returns
RetrieveMultipleAsync(QueryBase, CancellationToken)
Retrieves a collection of records.
Task<EntityCollection> RetrieveMultipleAsync(QueryBase query, CancellationToken cancellationToken = default)
Parameters
queryQueryBaseType: QueryBase. A query that determines the set of records to retrieve.
cancellationTokenCancellationToken
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
entityEntityType: Entity. An entity instance that has one or more properties set to be updated in the record.
cancellationTokenCancellationToken