Exemplo n.º 1
0
        public async Task Handle(ProcessFileUpdatedEvent message, CancellationToken token)
        {
            var processFile = await _processFileQueryRepository.Get(message.AggregateId, token);

            processFile.Handle(message);
            await _processFileCommandRepository.Update(processFile, token);

            await _processFileCommandRepository.SaveChanges(token);
        }
        public async Task <ProcessFileResult> Handle(GetProcessFileQuery request, CancellationToken cancellationToken)
        {
            var result = await _processFileQueryRepository.Get(request.Id, cancellationToken);

            if (result == null)
            {
                throw new UnknownProcessFileException(string.Format(Global.UnknownProcessFile, request.Id));
            }

            return(ProcessFileResult.ToDto(result));
        }