Interface IJobResultStorage
addon interface to enable storage of job results on a job storage record (IJobStorageRecord)
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public interface IJobResultStorage
Properties
Result
the actual result object that will be embedded in the storage record. if your database/orm (such as ef-core) doesn't support embedding objects, you can take the following steps:
1. add a [NotMapped] attribute to this property.
2. add a new property, either a string or byte[]
3. implement both GetResult() and SetResult() methods to serialize/deserialize the command object back and forth and store it in the newly added property.
you may use any serializer you please. recommendation is to use MessagePack.
Declaration
object? Result { get; set; }
Property Value
Type | Description |
---|---|
object |
Methods
GetResult<TResult>()
implement this function to customize the result deserialization.
Declaration
TResult? GetResult<TResult>()
Returns
Type | Description |
---|---|
TResult |
Type Parameters
Name | Description |
---|---|
TResult |
SetResult<TResult>(TResult)
implement this method to customize the result serialization.
Declaration
void SetResult<TResult>(TResult result)
Parameters
Type | Name | Description |
---|---|---|
TResult | result |
Type Parameters
Name | Description |
---|---|
TResult |