public async Task <TResponse> Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate <TResponse> next)
        {
            Model.EventLog commandLog = null;

            if (request is ICommandEvent)
            {
                commandLog = Model.EventLog.Create(request);
            }

            var response = await next();

            if (commandLog != null)
            {
                if (response is UploadAudioCommandResult)
                {
                    var rspObj = response as UploadAudioCommandResult;

                    commandLog.AddProfileId(rspObj.ProfileId);
                }

                commandLog.AddResult(response);
                await _queueService.AddMessage(commandLog);
            }

            return(response);
        }
        public async Task <TResponse> Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate <TResponse> next)
        {
            Model.EventLog commandLog = null;

            var response = await next();

            if (request is ICommandEvent)
            {
                commandLog = Model.EventLog.Create(request);
            }

            if (commandLog != null)
            {
                commandLog.AddResult(response);
                await _queueService.AddMessage(commandLog);
            }

            return(response);
        }