Interface IPersistenceService
Service port for the persistence aggregate. Mirrors the operations exposed by PersistenceUseCases so persistence can be resolved and extended like any other Serenity service.
Inherited Members
Namespace: Serenity.Persistence.Application.Interfaces
Assembly: Serenity.Global.Application.dll
Syntax
public interface IPersistenceService : IService, IFoundationSettings
Methods
AppendBytesAsync(PersistenceAppendBytesInput, CancellationToken)
Appends a byte array to an existing blob in the store.
Declaration
Task AppendBytesAsync(PersistenceAppendBytesInput input, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| PersistenceAppendBytesInput | input | The key, data to append, and creation policy. |
| CancellationToken | cancellationToken | A token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous append operation. |
LoadBytesAsync(PersistenceLoadBytesInput, CancellationToken)
Loads a byte array from the blob store.
Declaration
Task<byte[]> LoadBytesAsync(PersistenceLoadBytesInput input, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| PersistenceLoadBytesInput | input | The key of the byte data to load. |
| CancellationToken | cancellationToken | A token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| Task<byte[]> | A task containing the loaded byte array. |
LoadObjectAsync<T>(PersistenceLoadObjectInput<T>, CancellationToken)
Loads a deserialized object from the blob store.
Declaration
Task<T> LoadObjectAsync<T>(PersistenceLoadObjectInput<T> input, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| PersistenceLoadObjectInput<T> | input | The key, serializer and optional transformer. |
| CancellationToken | cancellationToken | A token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| Task<T> | A task containing the loaded and deserialized object. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the object to load. |
SaveBytesAsync(PersistenceSaveBytesInput, CancellationToken)
Saves a byte array to the blob store.
Declaration
Task SaveBytesAsync(PersistenceSaveBytesInput input, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| PersistenceSaveBytesInput | input | The key and byte data to store. |
| CancellationToken | cancellationToken | A token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous save operation. |
SaveObjectAsync<T>(PersistenceSaveObjectInput<T>, CancellationToken)
Saves a serialized object to the blob store.
Declaration
Task SaveObjectAsync<T>(PersistenceSaveObjectInput<T> input, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| PersistenceSaveObjectInput<T> | input | The key, value, serializer and optional transformer. |
| CancellationToken | cancellationToken | A token to monitor for cancellation requests. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous save operation. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the object to save. |