Ejemplo n.º 1
0
        public void LogRequest(RequestLog request)
        {
            ConvertRequestLog data = new ConvertRequestLog
            {
                RequestId        = request.RequestId,
                RequestDateUtc   = request.RequestDateUtc,
                SenderIp         = request.SenderIp,
                FileExtension    = request.FileExtension,
                FileSize         = request.FileSize,
                CustomAttributes = request.CustomAttributes
            };

            new CreateConvertRequestLog(this.convertLogRepository).Execute(data);
        }
        public void Execute(ConvertRequestLog requestLog)
        {
            ConvertRequest data = new ConvertRequest
            {
                ConvertRequestId = requestLog.RequestId,
                RequestDateUtc   = requestLog.RequestDateUtc,
                SenderIp         = requestLog.SenderIp,
                FileExtension    = requestLog.FileExtension,
                FileSize         = requestLog.FileSize,
                FileType         = this.convertLogRepository.GetFileTypeByExtension(requestLog.FileExtension),
                CustomAttributes = requestLog.CustomAttributes == null ? null : string.Join(";", requestLog.CustomAttributes.Select(p => $"{p.Key}=\"{p.Value}\""))
            };

            this.convertLogRepository.CreateConvertRequest(data);
        }