public IHttpActionResult PostProduct(ProductAPI.core.Entities.Product product) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Add(product); return(CreatedAtRoute("DefaultApi", new { id = product.ProductID }, product)); }
public Product PostProduct(Product item) { return(repository.Add(item)); }