public virtual async Task SaveRequest(string actionName, ActorRequestContext actorRequestContext, Type typeOfPayload, byte[] entity, CancellationToken cancellationToken)
        {
            try
            {
                await StateManager.AddStateAsync(NameCompositionResolver.GenerateRequestContextStateName(actionName, actorRequestContext.RequestId), actorRequestContext, cancellationToken);

                await StateManager.AddStateAsync(NameCompositionResolver.GenerateRequestPayloadStateName(actionName, actorRequestContext.RequestId), entity, cancellationToken);

                await StateManager.AddStateAsync(NameCompositionResolver.GenerateRequestPayloadTypeStateName(actionName, actorRequestContext.RequestId), typeOfPayload.AssemblyQualifiedName, cancellationToken);

                //As cancellation token cant be serialized & replicated to other node and cant be used to invoke cancellation
                //await StateManager.AddStateAsync(NameCompositionResolver.GenerateRequestCanncellationTokenStateName(actionName, actorRequestContext.RequestId), cancellationToken, cancellationToken);

                //UnComment if wantting to deal with status of the requests

                /*
                 * await StateManager.AddStateAsync(
                 *  NameCompositionResolver.GenerateRequestStateStateName(actionName,
                 *      actorRequestContext.RequestId), false, cancellationToken);
                 * //add current latest reminder name for any current info. due to the single thread behaviour of actors, this is valid
                 * await StateManager.AddOrUpdateStateAsync(ACTOR_REMINDER_LATEST_STATE_NAME, NameCompositionResolver.GenerateReminderName(actionName, actorRequestContext.RequestId),
                 *  (s, reminderName) => reminderName, cancellationToken);
                 */
            }
            catch (InvalidOperationException ex)
            {
                //add an already existed state
                //throw;
            }
        }
 public async Task <TModel> RetrieveRequestPayloadAsync <TModel>(string actionName, string requestId, CancellationToken cancellationToken)
 {
     return(await StateManager.GetStateAsync <TModel>(NameCompositionResolver.GenerateRequestPayloadStateName(actionName, requestId)));
 }