public async Task FlushAsync(CreateRequestLogRequest request, IList <LoggerFile> files = null) { try { ApiResult <RequestLog> requestLog = await _kissLogApi.CreateRequestLogAsync(request).ConfigureAwait(false); if (requestLog.HasException == false && files?.Any() == true) { string requestLogId = requestLog?.Result?.Id; await UploadRequestLogFilesAsync(requestLogId, request, files); } } finally { DeleteFiles(files); } }
public async Task FlushAsync(CreateRequestLogRequest request, IList <LoggerFile> files = null) { IList <File> requestFiles = files == null ? null : files.Select(p => new File { FileName = p.FileName, Extension = p.Extension, FullFileName = p.FullFileName, FilePath = p.FilePath }).ToList(); try { ApiResult <RequestLog> requestLog = await _kissLogApi.CreateRequestLogAsync(request, requestFiles).ConfigureAwait(false); } finally { DeleteFiles(files); } }