public IActionResult Put(int id, [FromBody] ProductItem obj) { if (iproduct.GetDetailbyId(id) == null) { return(BadRequest()); } if (iproduct.AddRating(id, obj.Rating)) { return(Ok()); } return(BadRequest()); }