Beispiel #1
0
        public async Task Handle(CustomerImageUploadCommand command, CancellationToken cancellationToken)
        {
            var originalEntry = await _context.Customers.SingleAsync(x =>
                                                                     x.CustomerId == command.CustomerId
                                                                     );

            // Save and get the file path
            _imageUploadService.Attach(command.File);
            var filePath = await _imageUploadService.SaveAsync();

            originalEntry.Photo = filePath;

            await _context.SaveChangesAsync();
        }