Interface ILongRunningOperationRepository
Represents a repository for managing long-running operations.
Namespace: Umbraco.Cms.Core.Persistence.Repositories
Assembly: Umbraco.Core.dll
Syntax
public interface ILongRunningOperationRepository
Methods
View SourceCleanOperationsAsync(DateTimeOffset)
Cleans up long-running operations that haven't been updated for a certain period of time.
Declaration
Task CleanOperationsAsync(DateTimeOffset olderThan)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTimeOffset | olderThan | The cutoff date and time for operations to be considered for deletion. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation. |
CreateAsync(LongRunningOperation, DateTimeOffset)
Creates a new long-running operation.
Declaration
Task CreateAsync(LongRunningOperation operation, DateTimeOffset expirationDate)
Parameters
| Type | Name | Description |
|---|---|---|
| LongRunningOperation | operation | The operation to create. |
| DateTimeOffset | expirationDate | The date and time when the operation should be considered stale. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation. |
GetAsync(Guid)
Retrieves a long-running operation by its ID.
Declaration
Task<LongRunningOperation?> GetAsync(Guid id)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The unique identifier of the long-running operation. |
Returns
| Type | Description |
|---|---|
| Task<LongRunningOperation> | The long-running operation if found; otherwise, null. |
GetAsync<T>(Guid)
Retrieves a long-running operation by its ID.
Declaration
Task<LongRunningOperation<T>?> GetAsync<T>(Guid id)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The unique identifier of the long-running operation. |
Returns
| Type | Description |
|---|---|
| Task<LongRunningOperation<T>> | The long-running operation if found; otherwise, null. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the result of the long-running operation. |
GetByTypeAsync(string, LongRunningOperationStatus[], int, int)
Gets all long-running operations of a specific type, optionally filtered by their statuses.
Declaration
Task<PagedModel<LongRunningOperation>> GetByTypeAsync(string type, LongRunningOperationStatus[] statuses, int skip, int take)
Parameters
| Type | Name | Description |
|---|---|---|
| string | type | Type of the long-running operation. |
| LongRunningOperationStatus[] | statuses | Array of statuses to filter the operations by. |
| int | skip | Number of entries to skip. |
| int | take | Number of entries to take. |
Returns
| Type | Description |
|---|---|
| Task<PagedModel<LongRunningOperation>> | A paged model of LongRunningOperation objects. |
GetStatusAsync(Guid)
Gets the status of a long-running operation by its unique identifier.
Declaration
Task<LongRunningOperationStatus?> GetStatusAsync(Guid id)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The unique identifier for the operation. |
Returns
| Type | Description |
|---|---|
| Task<LongRunningOperationStatus?> | The long-running operation if found; otherwise, null. |
SetResultAsync<T>(Guid, T)
Sets the result of a long-running operation identified by its ID.
Declaration
Task SetResultAsync<T>(Guid id, T result)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The unique identifier of the long-running operation. |
| T | result | The result of the operation. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the result. |
UpdateStatusAsync(Guid, LongRunningOperationStatus, DateTimeOffset)
Updates the status of a long-running operation identified by its ID.
Declaration
Task UpdateStatusAsync(Guid id, LongRunningOperationStatus status, DateTimeOffset expirationDate)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The unique identifier of the long-running operation. |
| LongRunningOperationStatus | status | The new status to set for the operation. |
| DateTimeOffset | expirationDate | The date and time when the operation should be considered stale. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation. |