Table of Contents

Class AsyncOrganizationServiceExtensions

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

Extension methods relating to IAsyncOrgService

public static class AsyncOrganizationServiceExtensions
Inheritance
AsyncOrganizationServiceExtensions
Inherited Members

Methods

FetchAllAsync(IAsyncOrgService, string, CancellationToken)

Pages through records until options.MaxResults is reached.

public static Task<List<Entity>> FetchAllAsync(this IAsyncOrgService svc, string query, CancellationToken cancellationToken = default)

Parameters

svc IAsyncOrgService
query string
cancellationToken CancellationToken

Returns

Task<List<Entity>>

FetchAllAsync<T>(IAsyncOrgService, string, CancellationToken)

Pages through records until options.MaxResults is reached.

public static Task<List<T>> FetchAllAsync<T>(this IAsyncOrgService svc, string query, CancellationToken cancellationToken = default) where T : Entity

Parameters

svc IAsyncOrgService
query string
cancellationToken CancellationToken

Returns

Task<List<T>>

Type Parameters

T

FetchPageAsync<T>(IAsyncOrgService, string, CancellationToken)

public static Task<EntityPage<T>> FetchPageAsync<T>(this IAsyncOrgService svc, string fetchXml, CancellationToken cancellationToken = default) where T : Entity

Parameters

svc IAsyncOrgService
fetchXml string
cancellationToken CancellationToken

Returns

Task<EntityPage<T>>

Type Parameters

T

RetrieveAllAsync(IAsyncOrgService, QueryExpression, CancellationToken)

Pages through records until options.MaxResults is reached.

public static Task<List<Entity>> RetrieveAllAsync(this IAsyncOrgService svc, QueryExpression query, CancellationToken cancellationToken = default)

Parameters

svc IAsyncOrgService
query QueryExpression
cancellationToken CancellationToken

Returns

Task<List<Entity>>

RetrieveAllAsync<T>(IAsyncOrgService, QueryExpression, CancellationToken)

Pages through records until options.MaxResults is reached.

public static Task<List<T>> RetrieveAllAsync<T>(this IAsyncOrgService svc, QueryExpression query, CancellationToken cancellationToken = default) where T : Entity

Parameters

svc IAsyncOrgService
query QueryExpression
cancellationToken CancellationToken

Returns

Task<List<T>>

Type Parameters

T

RetrieveAsync(IAsyncOrgService, EntityReference, ColumnSet)

Retrieve by either a reference to a primary or alternate key of an entity.

public static Task<Entity> RetrieveAsync(this IAsyncOrgService svc, EntityReference entity, ColumnSet columnSet)

Parameters

svc IAsyncOrgService
entity EntityReference
columnSet ColumnSet

Returns

Task<Entity>

RetrieveAsync<T>(IAsyncOrgService, EntityReference, ColumnSet)

Retrieve by either a reference to a primary or alternate key of an entity.

public static Task<T> RetrieveAsync<T>(this IAsyncOrgService svc, EntityReference entity, ColumnSet columnSet) where T : Entity

Parameters

svc IAsyncOrgService
entity EntityReference
columnSet ColumnSet

Returns

Task<T>

Type Parameters

T

RetrievePageAsync<T>(IAsyncOrgService, QueryExpression, CancellationToken)

Pages through records until options.MaxResults is reached.

public static Task<EntityPage<T>> RetrievePageAsync<T>(this IAsyncOrgService svc, QueryExpression query, CancellationToken cancellationToken = default) where T : Entity

Parameters

svc IAsyncOrgService
query QueryExpression
cancellationToken CancellationToken

Returns

Task<EntityPage<T>>

Type Parameters

T

ToAsyncOrgService(IOrganizationService)

Generates a wrapper for the given org service that uses Task.Run.

public static IAsyncOrgService ToAsyncOrgService(IOrganizationService svc)

Parameters

svc IOrganizationService

Returns

IAsyncOrgService