예제 #1
0
        public async Task <ProductDto> Create(ProductDto productModel)
        {
            var addproduct = ProductInfo.Create(productModel.ProductName, productModel.Category, productModel.Description, productModel.ImageFile, productModel.Price);

            var productinfo = await this._productRepository.AddAsync(addproduct);

            return(new ProductDto()
            {
                ProductId = productinfo.Id,
                ProductName = productinfo.Name,
                Category = productinfo.Category,
                Price = productinfo.Price,
                Description = productinfo.Description,
                ImageFile = productinfo.ImageFile,
                Status = productinfo.Status,
                Summary = productinfo.Summary
            });
        }