Class TermsApprovalStore
Manages terms approval records in Azure Cosmos DB.
Implements
Inherited Members
Namespace: DataWeb.Terms.AzureCosmosDB
Assembly: DataWeb.Data.AzureCosmosDB.dll
Syntax
public class TermsApprovalStore : ITermsApprovalStore
Constructors
TermsApprovalStore(ICosmosHelper, IConfigurationService, TimeProvider)
Manages terms approval records in Azure Cosmos DB.
Declaration
public TermsApprovalStore(ICosmosHelper cosmosHelper, IConfigurationService configurationService, TimeProvider timeProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| ICosmosHelper | cosmosHelper | |
| IConfigurationService | configurationService | |
| TimeProvider | timeProvider |
Properties
Name
The name of the store
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
ExistsAsync(TermsApprovalFilter, CancellationToken)
Determines whether any terms approval matching the specified filter criteria exists.
Declaration
public Task<bool> ExistsAsync(TermsApprovalFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TermsApprovalFilter | filter | The filter criteria for terms approvals. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<bool> | true if at least one matching record exists; otherwise, false. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when filter is null. |
GetTermsApprovalAsync(TermsApprovalFilter, CancellationToken)
Retrieves a single terms approval matching the specified filter criteria.
Declaration
public Task<TermsApproval> GetTermsApprovalAsync(TermsApprovalFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TermsApprovalFilter | filter | The filter criteria for the terms approval. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<TermsApproval> | The first terms approval matching the filter, or null if no match found. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when filter is null. |
GetTermsApprovalsAsync(TermsApprovalFilter, CancellationToken)
Retrieves terms approvals matching the specified filter criteria.
Declaration
public Task<IEnumerable<TermsApproval>> GetTermsApprovalsAsync(TermsApprovalFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TermsApprovalFilter | filter | The filter criteria for terms approvals. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<TermsApproval>> | A collection of terms approvals matching the filter. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when filter is null. |
SetAsync(TermsApproval, CancellationToken)
Creates a new terms approval record.
Declaration
public Task SetAsync(TermsApproval termsApproval, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TermsApproval | termsApproval | The terms approval to create. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when termsApproval is null. |