예제 #1
0
        //[Authorize(Policy = Policies.Seller)]
        public async Task <ActionResult> AddNewProduct([FromForm] ProductModel newProduct)
        {
            if (newProduct == null)
            {
                return(BadRequest());
            }

            try
            {
                await _sellerService.AddProducts(newProduct);

                return(Ok($"Added product {newProduct.Title} to the database"));
            }

            catch (Exception ex) { throw ex; }
        }