Esempio n. 1
0
        public async Task <IActionResult> GetById(int productId, string languageId)
        {
            var product = await _manageProductService.GetProductById(productId, languageId);

            if (product == null)
            {
                return(BadRequest("Can not found product"));
            }
            return(Ok(product));
        }
        public async Task <IActionResult> Create([FromForm] ProductCreateRequest request)
        {
            var result = await _manageProduct.CreateProduct(request);

            if (result == 0)
            {
                return(BadRequest());
            }
            else
            {
                return(new OkObjectResult(await _manageProduct.GetProductById(result)));
            }
        }