Skip to content

Adjust Stored Request Data

This feature is available exclusively through the extension package: TickerQ.EntityFrameworkCore.

Adjust Store/Retrieve data

  • Current:

When we stored the request we used the helper: Storing jobs in database code-line 3:

csharp
Request = TickerHelper.CreateTickerRequest<string>("Hello") 
CreateTickerRequest compresses the data into GZip and stores in database as ByteArray.
  • Update:

Once you decide against using TickerHelper for data storage and opt to create your own mechanism, you must also override the data retrieval method.

csharp
Request = //your code

Override the retrieving request.

Override the method GetRequestValueAsync of TickerController in your class:

csharp
public class MyFirstExample : TickerController
{
  [TickerFunction(FunctionName: "ExampleTicker")]
  public async Task ExampleTicker(TickerFunctionContext<string> tickerContext, CancellationToken cancellationToken)
  {
     await tickerContext.Request.Value; // Outputs GetRequestValueAsync...
  }

  public override Task<T> GetRequestValueAsync<T>(Guid tickerId, TickerType tickerType)
  { 
     // retrieve stored request data code... 
  }  
}