Example #1
0
        public async Task CreateProduct(CreateUpdateProductDto input)
        {
            var fileName = GetImageName(input);
            //await StorageImageAsync(input, fileName);

            var product = new Product(guidGenerator.Create())
            {
                Name   = input.Name,
                Price  = input.Price,
                Amount = input.Amount,
                Image  = fileName,
            };

            await productDomainService.CreateProduct(product);
        }
        public ProductResponse CreateProduct([FromBody] ProductRequest request)
        {
            var model = request.MapFromRequest();

            return(_productDomainService.CreateProduct(model).MapToResponse());
        }