Ejemplo n.º 1
0
        private async Task BackUpMessage(TRequest request, MediatRActionsEnum queueAction = MediatRActionsEnum.Sent, bool increaseRetryCounter = false, string additionalData = null, string errorData = null)
        {
            MediatRBackupLiteDbService?.CreateResponseMessageBackup(request, queueAction, increaseRetryCounter, additionalData, errorData);

            if (MediatRBackupService != null && MediatRBackupService.UseExternalDatabase)
            {
                await MediatRBackupService.CreateResponseMessageBackup(request, queueAction, increaseRetryCounter, additionalData, errorData).ConfigureAwait(false);
            }
        }
Ejemplo n.º 2
0
        private async Task BackUpMessage <TResult>(ActionBase <TResult> command, MediatrActions queueAction = MediatrActions.Sent, bool increaseRetryCounter = false, string additionalData = null, string errorData = null) where TResult : class
        {
            try
            {
                MediatRBackupLiteDbService?.CreateMessageBackup(command, queueAction, increaseRetryCounter, additionalData, errorData);

                if (MediatRBackupService?.UseExternalDatabase == true)
                {
                    await MediatRBackupService.CreateMessageBackup(command, queueAction, increaseRetryCounter, additionalData, errorData).ConfigureAwait(false);
                }
            }
            catch (Exception ex)
            {
                Devon4NetLogger.Error($"Error making the backup of the MediatR action base. {ex.Message} {ex.InnerException}");
                Devon4NetLogger.Error(ex);
                throw;
            }
        }