예제 #1
0
        public async Task <IActionResult> Register([FromBody] ProductRegisterDto product)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var result = await _repo.Register(product);

            if (result != null)
            {
                return(Ok(result));
            }
            return(StatusCode(500, "Unable to add product. Try again later."));
        }