Skip to main content

DataverseClient

  • Namespace: PPDS.Dataverse.Client
  • Assembly: PPDS.Dataverse
  • Kind: Class
  • Implements: IOrganizationServiceAsync, IOrganizationServiceAsync2, IOrganizationService, IDataverseClient, IDisposable

Summary​

Implementation of PPDS.Dataverse.Client.IDataverseClient that wraps a Microsoft.PowerPlatform.Dataverse.Client.ServiceClient. Provides a consistent abstraction over the Dataverse SDK.

Members​

Constructors​

DataverseClient(ServiceClient serviceClient)​

DataverseClient(ServiceClient serviceClient)

Initializes a new instance of the PPDS.Dataverse.Client.DataverseClient class.

  • Param serviceClient: The underlying ServiceClient to wrap.

DataverseClient(string connectionString)​

DataverseClient(string connectionString)

Initializes a new instance of the PPDS.Dataverse.Client.DataverseClient class using a connection string.

  • Param connectionString: The Dataverse connection string.

Methods​

Associate​

void Associate(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities)

(inherited from Microsoft.Xrm.Sdk.IOrganizationService.Associate(System.String,System.Guid,Microsoft.Xrm.Sdk.Relationship,Microsoft.Xrm.Sdk.EntityReferenceCollection))

AssociateAsync​

Task AssociateAsync(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities)

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync.AssociateAsync(System.String,System.Guid,Microsoft.Xrm.Sdk.Relationship,Microsoft.Xrm.Sdk.EntityReferenceCollection))

AssociateAsync​

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

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync2.AssociateAsync(System.String,System.Guid,Microsoft.Xrm.Sdk.Relationship,Microsoft.Xrm.Sdk.EntityReferenceCollection,System.Threading.CancellationToken))

Clone​

IDataverseClient Clone()

Creates a clone of this client that shares the underlying connection. Cloning is significantly faster than creating a new connection.

  • Returns: A cloned client instance.

Create​

Guid Create(Entity entity)

(inherited from Microsoft.Xrm.Sdk.IOrganizationService.Create(Microsoft.Xrm.Sdk.Entity))

CreateAndReturnAsync​

Task<Entity> CreateAndReturnAsync(Entity entity, CancellationToken cancellationToken)

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync2.CreateAndReturnAsync(Microsoft.Xrm.Sdk.Entity,System.Threading.CancellationToken))

CreateAsync​

Task<Guid> CreateAsync(Entity entity)

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync.CreateAsync(Microsoft.Xrm.Sdk.Entity))

CreateAsync​

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

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync2.CreateAsync(Microsoft.Xrm.Sdk.Entity,System.Threading.CancellationToken))

Delete​

void Delete(string entityName, Guid id)

(inherited from Microsoft.Xrm.Sdk.IOrganizationService.Delete(System.String,System.Guid))

DeleteAsync​

Task DeleteAsync(string entityName, Guid id)

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync.DeleteAsync(System.String,System.Guid))

DeleteAsync​

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

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync2.DeleteAsync(System.String,System.Guid,System.Threading.CancellationToken))

Disassociate​

void Disassociate(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities)

(inherited from Microsoft.Xrm.Sdk.IOrganizationService.Disassociate(System.String,System.Guid,Microsoft.Xrm.Sdk.Relationship,Microsoft.Xrm.Sdk.EntityReferenceCollection))

DisassociateAsync​

Task DisassociateAsync(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities)

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync.DisassociateAsync(System.String,System.Guid,Microsoft.Xrm.Sdk.Relationship,Microsoft.Xrm.Sdk.EntityReferenceCollection))

DisassociateAsync​

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

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync2.DisassociateAsync(System.String,System.Guid,Microsoft.Xrm.Sdk.Relationship,Microsoft.Xrm.Sdk.EntityReferenceCollection,System.Threading.CancellationToken))

Dispose​

void Dispose()

Disposes of the client and releases resources.

Execute​

OrganizationResponse Execute(OrganizationRequest request)

(inherited from Microsoft.Xrm.Sdk.IOrganizationService.Execute(Microsoft.Xrm.Sdk.OrganizationRequest))

ExecuteAsync​

Task<OrganizationResponse> ExecuteAsync(OrganizationRequest request)

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync.ExecuteAsync(Microsoft.Xrm.Sdk.OrganizationRequest))

ExecuteAsync​

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

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync2.ExecuteAsync(Microsoft.Xrm.Sdk.OrganizationRequest,System.Threading.CancellationToken))

GetRawWebApiAsync​

Task<string> GetRawWebApiAsync(string queryString, CancellationToken ct)

GETs a raw WebAPI query string and returns the response body as JSON. Used to traverse OData navigation properties not exposed as SDK attributes. Returns null on 404 or if the response is empty.

Retrieve​

Entity Retrieve(string entityName, Guid id, ColumnSet columnSet)

(inherited from Microsoft.Xrm.Sdk.IOrganizationService.Retrieve(System.String,System.Guid,Microsoft.Xrm.Sdk.Query.ColumnSet))

RetrieveAsync​

Task<Entity> RetrieveAsync(string entityName, Guid id, ColumnSet columnSet)

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync.RetrieveAsync(System.String,System.Guid,Microsoft.Xrm.Sdk.Query.ColumnSet))

RetrieveAsync​

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

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync2.RetrieveAsync(System.String,System.Guid,Microsoft.Xrm.Sdk.Query.ColumnSet,System.Threading.CancellationToken))

RetrieveMultiple​

EntityCollection RetrieveMultiple(QueryBase query)

(inherited from Microsoft.Xrm.Sdk.IOrganizationService.RetrieveMultiple(Microsoft.Xrm.Sdk.Query.QueryBase))

RetrieveMultipleAsync​

Task<EntityCollection> RetrieveMultipleAsync(QueryBase query)

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync.RetrieveMultipleAsync(Microsoft.Xrm.Sdk.Query.QueryBase))

RetrieveMultipleAsync​

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

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync2.RetrieveMultipleAsync(Microsoft.Xrm.Sdk.Query.QueryBase,System.Threading.CancellationToken))

Update​

void Update(Entity entity)

(inherited from Microsoft.Xrm.Sdk.IOrganizationService.Update(Microsoft.Xrm.Sdk.Entity))

UpdateAsync​

Task UpdateAsync(Entity entity)

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync.UpdateAsync(Microsoft.Xrm.Sdk.Entity))

UpdateAsync​

Task UpdateAsync(Entity entity, CancellationToken cancellationToken)

(inherited from Microsoft.PowerPlatform.Dataverse.Client.IOrganizationServiceAsync2.UpdateAsync(Microsoft.Xrm.Sdk.Entity,System.Threading.CancellationToken))

Properties​

CallerAADObjectId​

Nullable<Guid> CallerAADObjectId { get; set; }

Gets or sets the caller AAD object ID for impersonation.

CallerId​

Guid CallerId { get; set; }

Gets or sets the caller ID for impersonation.

ConnectedOrgFriendlyName​

string ConnectedOrgFriendlyName { get; }

Gets the connected organization friendly name.

ConnectedOrgId​

Nullable<Guid> ConnectedOrgId { get; }

Gets the connected organization ID.

ConnectedOrgUniqueName​

string ConnectedOrgUniqueName { get; }

Gets the connected organization unique name.

ConnectedOrgVersion​

Version ConnectedOrgVersion { get; }

Gets the connected organization version.

IsReady​

bool IsReady { get; }

Gets a value indicating whether the connection is ready for operations.

LastError​

string LastError { get; }

Gets the last error message from the service. Returns null when no error has occurred or the client is in a healthy state.

LastException​

Exception LastException { get; }

Gets the last exception from the service. Returns null when no exception has occurred or the client is in a healthy state.

MaxRetryCount​

int MaxRetryCount { get; set; }

Gets or sets the maximum number of retry attempts for transient failures.

RecommendedDegreesOfParallelism​

int RecommendedDegreesOfParallelism { get; }

Gets the server-recommended degree of parallelism for bulk operations.

RetryPauseTime​

TimeSpan RetryPauseTime { get; set; }

Gets or sets the pause time between retry attempts.