/// <summary>
        /// Get or add a payload to the context, using the provided payload factory.
        /// </summary>
        /// <param name="payloadFactory">The payload factory, which is only invoked if the payload is not present.</param>
        /// <typeparam name="T">The payload type</typeparam>
        /// <returns></returns>
        public override T GetOrAddPayload <T>(PayloadFactory <T> payloadFactory)
        {
            if (this is T context)
            {
                return(context);
            }

            return(ReceiveContext.GetOrAddPayload(payloadFactory));
        }
 public virtual TPayload GetOrAddPayload <TPayload>(PayloadFactory <TPayload> payloadFactory) where TPayload : class
 {
     return(_context.GetOrAddPayload(payloadFactory));
 }