Class AnalyticsGoalStore
Implements
Inherited Members
Namespace: DataWeb.Analytics.AzureCosmosDB
Assembly: DataWeb.Data.AzureCosmosDB.dll
Syntax
public class AnalyticsGoalStore : IAnalyticsGoalStore
Constructors
AnalyticsGoalStore(ICosmosHelper, IConfigurationService, TimeProvider)
Declaration
public AnalyticsGoalStore(ICosmosHelper cosmosHelper, IConfigurationService configurationService, TimeProvider timeProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| ICosmosHelper | cosmosHelper | |
| IConfigurationService | configurationService | |
| TimeProvider | timeProvider |
Properties
Name
Gets the name of the store implementation.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
GetGoalAsync(AnalyticsGoalFilter, CancellationToken)
Retrieves the first analytics goal matching the specified filter, or null if none is found.
Declaration
public Task<AnalyticsGoal> GetGoalAsync(AnalyticsGoalFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AnalyticsGoalFilter | filter | The filter criteria used to query the analytics goal. |
| CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task<AnalyticsGoal> | The first matching AnalyticsGoal, or null. |
GetGoalCountAsync(AnalyticsGoalFilter, CancellationToken)
Returns the total number of analytics goals matching the specified filter.
Declaration
public Task<long> GetGoalCountAsync(AnalyticsGoalFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AnalyticsGoalFilter | filter | The filter criteria used to count analytics goals. |
| CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task<long> | The count of matching goals. |
GetGoalTotalValueAsync(AnalyticsGoalFilter, CancellationToken)
Returns the sum of the Value field for all goals matching the specified filter.
Declaration
public Task<decimal> GetGoalTotalValueAsync(AnalyticsGoalFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AnalyticsGoalFilter | filter | The filter criteria used to aggregate goal values. |
| CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task<decimal> | The total value of matching goals. |
GetGoalsAsync(AnalyticsGoalFilter, CancellationToken)
Retrieves a collection of analytics goals matching the specified filter.
Declaration
public Task<IEnumerable<AnalyticsGoal>> GetGoalsAsync(AnalyticsGoalFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AnalyticsGoalFilter | filter | The filter criteria used to query analytics goals. |
| CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<AnalyticsGoal>> | A collection of AnalyticsGoal matching the filter. |
SetAsync(AnalyticsGoal, CancellationToken)
Persists a new analytics goal to the store.
Declaration
public Task SetAsync(AnalyticsGoal goal, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AnalyticsGoal | goal | The analytics goal to save. |
| CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task |