Esempio n. 1
0
        public async Task Handle(UploadImage message)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            var product = await _productRepository.Get(message.Id);

            await product.UploadImage(_imageStoreService, message.File.OpenReadStream(), Path.GetExtension(message.File.FileName));

            await _productRepository.Save(product);
        }
Esempio n. 2
0
        public async Task <IActionResult> UploadImage(UploadImage uploadImage)
        {
            await _mediator.Send(uploadImage);

            return(NoContent());
        }